diff --git a/src/components/device-page/info.tsx b/src/components/device-page/info.tsx index 227ed2a9a..894dc78a3 100644 --- a/src/components/device-page/info.tsx +++ b/src/components/device-page/info.tsx @@ -183,7 +183,7 @@ export class DeviceInfo extends Component< }, { key: 'software_build_id', - translationKey: 'firmware_version', + translationKey: 'firmware_id', if: 'software_build_id', }, diff --git a/src/components/features/composite/color/color.tsx b/src/components/features/composite/color/color.tsx index b967df562..29f9888f3 100644 --- a/src/components/features/composite/color/color.tsx +++ b/src/components/features/composite/color/color.tsx @@ -15,7 +15,7 @@ const Light: FunctionComponent = (props) => { } return ( onChange(feature.endpoint as Endpoint, { color })} + onChange={(color) => onChange(feature.endpoint as Endpoint, { [feature.property ?? 'color']: color })} value={value as AnyColor} format={feature.name} minimal={minimal} diff --git a/src/components/features/gradient/gradient.tsx b/src/components/features/gradient/gradient.tsx index 0fcf8dc3a..c3b54889a 100644 --- a/src/components/features/gradient/gradient.tsx +++ b/src/components/features/gradient/gradient.tsx @@ -29,7 +29,7 @@ function Gradient(props: GradientProps & WithTranslation<'gradient'>) { t, minimal, onChange, - feature: { endpoint, length_min, length_max }, + feature: { endpoint, length_min, length_max, property }, deviceState, } = props; const [colors, setColors] = useState>(Array(gradientColors).fill({ x: 0, y: 0 })); @@ -94,7 +94,7 @@ function Gradient(props: GradientProps & WithTranslation<'gradient'>) {
diff --git a/src/components/ota-page/index.tsx b/src/components/ota-page/index.tsx index ac531eb02..5e6476117 100644 --- a/src/components/ota-page/index.tsx +++ b/src/components/ota-page/index.tsx @@ -37,7 +37,11 @@ const StateCell: FunctionComponent = (props) => { {otaState.progress}%
-
{t('remaining_time', { remaining: toHHMMSS(otaState.remaining) })}
+
+ {t('remaining_time', { + remaining: otaState.remaining != null ? toHHMMSS(otaState.remaining) : 'N/A', + })} +
); case 'available': @@ -185,17 +189,31 @@ class OtaPage extends Component }) => , }, { - Header: t('zigbee:firmware_installed_version') as string, + Header: t('zigbee:firmware_id') as string, + accessor: ({ device }) => device.software_build_id, + Cell: ({ + row: { + original: { device }, + }, + }) => ( + <> + + ({device.date_code ?? 'N/A'}) + + ), + }, + { + Header: t('zigbee:installed_version') as string, accessor: ({ state }) => { const installed_version = ((state?.update ?? {}) as OTAState).installed_version; if (typeof installed_version === 'number' && installed_version >= 0) return fileVersion2String(installed_version); - else return t('zigbee:firmware_installed_version_na'); + else return t('zigbee:installed_version_na'); }, }, { - Header: t('zigbee:firmware_available_version') as string, + Header: t('zigbee:available_version') as string, accessor: ({ state }) => { const latest_version = ((state?.update ?? {}) as OTAState).latest_version; diff --git a/src/components/vendor-links/vendor-links.tsx b/src/components/vendor-links/vendor-links.tsx index a5e8d5059..06908d6b2 100644 --- a/src/components/vendor-links/vendor-links.tsx +++ b/src/components/vendor-links/vendor-links.tsx @@ -51,7 +51,7 @@ export const ModelLink: React.FunctionComponent = (props: VendorPro export const OTALink: React.FunctionComponent = (props: VendorProps) => { const { device } = props; let url = ''; - const title = device.software_build_id; + const title = device.software_build_id ?? 'N/A'; switch (device?.definition?.vendor) { case 'IKEA': diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 377a7ad71..9977dccc8 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json @@ -2659,10 +2659,10 @@ "device_type": "Device type", "endpoint": "Endpoint", "firmware_build_date": "Firmware build date", - "firmware_version": "Firmware version", - "firmware_installed_version": "Firmware installed version", - "firmware_available_version": "Firmware available version", - "firmware_installed_version_na": "Not yet reported by device", + "firmware_id": "Firmware ID", + "installed_version": "Installed version", + "available_version": "Available version", + "installed_version_na": "Not yet reported by device", "force_remove": "Force remove", "friendly_name": "Friendly name", "ieee_address": "IEEE Address", diff --git a/src/i18n/locales/eu.json b/src/i18n/locales/eu.json index f9a96e3bb..505d111f2 100644 --- a/src/i18n/locales/eu.json +++ b/src/i18n/locales/eu.json @@ -2646,7 +2646,7 @@ "device_type": "Gailu moeta", "endpoint": "Endpoint", "firmware_build_date": "Firmware eraikitze data", - "firmware_version": "Firmware bertsioa", + "firmware_id": "Firmware ID", "force_remove": "Force remove", "friendly_name": "Lagunarteko izena", "ieee_address": "IEEE Helbidea", diff --git a/src/types.ts b/src/types.ts index f20aa250f..678f5c1b2 100644 --- a/src/types.ts +++ b/src/types.ts @@ -7,8 +7,10 @@ export type IEEEEAddress = string; export type OTAState = { state: 'available' | 'updating' | 'scheduled'; - progress: number; - remaining: number; + progress?: number; + remaining?: number; + installed_version: number | null; + latest_version: number | null; }; export type RGBColor = { r: number;