File tree Expand file tree Collapse file tree 2 files changed +2
-5
lines changed Expand file tree Collapse file tree 2 files changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -6,15 +6,12 @@ type ImageGeneratorFn = (device: Device) => string | undefined;
66const z2mBasePath = 'https://www.zigbee2mqtt.io/images/devices/' ;
77
88export const getZ2mDeviceImage = ( device : Device ) : string =>
9- `${ z2mBasePath } ${ sanitizeZ2MDeviceName ( device ?. definition ?. model ) } .jpg` ;
10- export const getZ2mDeviceImagePng = ( device : Device ) : string =>
119 `${ z2mBasePath } ${ sanitizeZ2MDeviceName ( device ?. definition ?. model ) } .png` ;
1210const getConverterDeviceImage = ( device : Device ) : string | undefined => device . definition ?. icon ;
1311
1412/* prettier-ignore */
1513export const AVAILABLE_GENERATORS : ImageGeneratorFn [ ] = [
1614 getConverterDeviceImage ,
17- getZ2mDeviceImagePng ,
1815 getZ2mDeviceImage ,
1916 ( ) => genericDevice ,
2017] ;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import Button from '../button';
55import { Device , IEEEEAddress } from '../../types' ;
66import { WithDevices } from '../../store' ;
77import { DeviceApi } from '../../actions/DeviceApi' ;
8- import { getZ2mDeviceImage , getZ2mDeviceImagePng } from '../device-image' ;
8+ import { getZ2mDeviceImage } from '../device-image' ;
99
1010type LocaliserState = 'none' | 'start' | 'inprogress' | 'done' ;
1111
@@ -52,7 +52,7 @@ function ImageLocaliser(props: Props): JSX.Element {
5252 setLocalisationStatus ( ( curr ) => {
5353 return { ...curr , [ device . ieee_address ] : 'init' } ;
5454 } ) ;
55- const success = await asyncSome ( [ getZ2mDeviceImagePng , getZ2mDeviceImage ] , async ( generator ) => {
55+ const success = await asyncSome ( [ getZ2mDeviceImage ] , async ( generator ) => {
5656 const imageUrl = generator ( device ) ;
5757 const imageContent = await downloadImage ( imageUrl ) ;
5858 await setDeviceOptions ( device . ieee_address , { icon : imageContent } ) ;
You can’t perform that action at this time.
0 commit comments