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;
6
6
const z2mBasePath = 'https://www.zigbee2mqtt.io/images/devices/' ;
7
7
8
8
export const getZ2mDeviceImage = ( device : Device ) : string =>
9
- `${ z2mBasePath } ${ sanitizeZ2MDeviceName ( device ?. definition ?. model ) } .jpg` ;
10
- export const getZ2mDeviceImagePng = ( device : Device ) : string =>
11
9
`${ z2mBasePath } ${ sanitizeZ2MDeviceName ( device ?. definition ?. model ) } .png` ;
12
10
const getConverterDeviceImage = ( device : Device ) : string | undefined => device . definition ?. icon ;
13
11
14
12
/* prettier-ignore */
15
13
export const AVAILABLE_GENERATORS : ImageGeneratorFn [ ] = [
16
14
getConverterDeviceImage ,
17
- getZ2mDeviceImagePng ,
18
15
getZ2mDeviceImage ,
19
16
( ) => genericDevice ,
20
17
] ;
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import Button from '../button';
5
5
import { Device , IEEEEAddress } from '../../types' ;
6
6
import { WithDevices } from '../../store' ;
7
7
import { DeviceApi } from '../../actions/DeviceApi' ;
8
- import { getZ2mDeviceImage , getZ2mDeviceImagePng } from '../device-image' ;
8
+ import { getZ2mDeviceImage } from '../device-image' ;
9
9
10
10
type LocaliserState = 'none' | 'start' | 'inprogress' | 'done' ;
11
11
@@ -52,7 +52,7 @@ function ImageLocaliser(props: Props): JSX.Element {
52
52
setLocalisationStatus ( ( curr ) => {
53
53
return { ...curr , [ device . ieee_address ] : 'init' } ;
54
54
} ) ;
55
- const success = await asyncSome ( [ getZ2mDeviceImagePng , getZ2mDeviceImage ] , async ( generator ) => {
55
+ const success = await asyncSome ( [ getZ2mDeviceImage ] , async ( generator ) => {
56
56
const imageUrl = generator ( device ) ;
57
57
const imageContent = await downloadImage ( imageUrl ) ;
58
58
await setDeviceOptions ( device . ieee_address , { icon : imageContent } ) ;
You can’t perform that action at this time.
0 commit comments