Skip to content

Commit 00a7786

Browse files
authored
fix(device_icon): remove jpg provider (#2335)
1 parent dc95dd7 commit 00a7786

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/components/device-image/index.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@ type ImageGeneratorFn = (device: Device) => string | undefined;
66
const z2mBasePath = 'https://www.zigbee2mqtt.io/images/devices/';
77

88
export 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`;
1210
const getConverterDeviceImage = (device: Device): string | undefined => device.definition?.icon;
1311

1412
/* prettier-ignore */
1513
export const AVAILABLE_GENERATORS: ImageGeneratorFn[] = [
1614
getConverterDeviceImage,
17-
getZ2mDeviceImagePng,
1815
getZ2mDeviceImage,
1916
() => genericDevice,
2017
];

src/components/settings-page/image-localiser.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Button from '../button';
55
import { Device, IEEEEAddress } from '../../types';
66
import { WithDevices } from '../../store';
77
import { DeviceApi } from '../../actions/DeviceApi';
8-
import { getZ2mDeviceImage, getZ2mDeviceImagePng } from '../device-image';
8+
import { getZ2mDeviceImage } from '../device-image';
99

1010
type 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 });

0 commit comments

Comments
 (0)