From b25c9518bb41c7e424678e1d61620ae4dd3bbe15 Mon Sep 17 00:00:00 2001 From: nurikk Date: Fri, 10 Dec 2021 09:24:18 +0800 Subject: [PATCH] chore(types): remove useless type cast --- src/components/zigbee/DevicesTable.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/zigbee/DevicesTable.tsx b/src/components/zigbee/DevicesTable.tsx index 120c03e43..f64bd3de7 100644 --- a/src/components/zigbee/DevicesTable.tsx +++ b/src/components/zigbee/DevicesTable.tsx @@ -26,13 +26,13 @@ export function DevicesTable(props: DevicesTableProps) { const { t } = useTranslation(["zigbee", "common", "avaliability"]); const lastSeenCol = lastSeenType !== "disable" ? [{ id: 'last_seen', - Header: t('last_seen') as string, + Header: t('last_seen'), accessor: ({ state }) => lastSeen(state, lastSeenType)?.getTime(), Cell: ({ row: { original: { state } } }) => , }] : []; const availabilityCol = availabilityFeatureEnabled ? [{ id: 'availability', - Header: t('avaliability:avaliability') as string, + Header: t('avaliability:avaliability'), accessor: ({ availabilityState }) => availabilityState, Cell: ({ row: { original: { availabilityState, availabilityEnabledForDevice } } }) => { return , accessor: rowData => rowData, disableSortBy: true, }, { id: 'friendly_name', - Header: t('friendly_name') as string, + Header: t('friendly_name'), accessor: ({ device }) => device.friendly_name, Cell: ({ row: { original: { device } } }) => {device.friendly_name} }, { id: 'ieee_address', - Header: t('ieee_address') as string, + Header: t('ieee_address'), accessor: ({ device }) => [device.ieee_address, toHex(device.network_address, 4)].join(' '), Cell: ({ row: { original: { device } } }) => <>{device.ieee_address} ({toHex(device.network_address, 4)}), }, { id: 'manufacturer', - Header: t('manufacturer') as string, + Header: t('manufacturer'), accessor: ({ device }) => [device.manufacturer, device.definition?.vendor].join(' '), Cell: ({ row: { original: { device } } }) => }, { id: 'model', - Header: t('model') as string, + Header: t('model'), accessor: ({ device }) => [device.model_id, device.definition?.model].join(' '), Cell: ({ row: { original: { device } } }) => }, { id: 'lqi', - Header: t('lqi') as string, + Header: t('lqi'), accessor: ({ state }) => state.linkquality, Cell: ({ row: { original: { state } } }) => , }, @@ -88,7 +88,7 @@ export function DevicesTable(props: DevicesTableProps) { ...availabilityCol, { id: 'power', - Header: t('power') as string, + Header: t('power'), accessor: ({ state }) => state.battery, Cell: ({ row: { original: { state, device } } }) => , },