diff --git a/interface/src/project/DashboardDevices.tsx b/interface/src/project/DashboardDevices.tsx index daa1a727a..23d632f3d 100644 --- a/interface/src/project/DashboardDevices.tsx +++ b/interface/src/project/DashboardDevices.tsx @@ -38,7 +38,7 @@ import DeviceIcon from './DeviceIcon'; import * as EMSESP from './api'; import { formatValue } from './deviceValue'; -import { DeviceValueUOM_s, DeviceEntityMask } from './types'; +import { DeviceValueUOM_s, DeviceEntityMask, DeviceType } from './types'; import { deviceValueItemValidation } from './validators'; import type { Device, CoreData, DeviceData, DeviceValue } from './types'; import type { FC } from 'react'; @@ -315,32 +315,37 @@ const DashboardDevices: FC = () => { const renderDeviceDetails = () => { if (coreData && coreData.devices.length > 0 && deviceDetails !== -1) { + const device = coreData.devices[deviceDetails]; return ( setDeviceDetails(-1)}> {LL.DEVICE_DETAILS()} - + - - - - - - - - - - - - - + + {device.t !== DeviceType.CUSTOM && ( + <> + + + + + + + + + + + + + + )} diff --git a/interface/src/project/DeviceIcon.tsx b/interface/src/project/DeviceIcon.tsx index 9db5dbacd..e471928f5 100644 --- a/interface/src/project/DeviceIcon.tsx +++ b/interface/src/project/DeviceIcon.tsx @@ -6,35 +6,13 @@ import { GiHeatHaze } from 'react-icons/gi'; import { MdThermostatAuto, MdOutlineSensors, MdOutlineExtension } from 'react-icons/md'; import { TiFlowSwitch } from 'react-icons/ti'; import { VscVmConnect } from 'react-icons/vsc'; +import { DeviceType } from './types'; import type { FC } from 'react'; interface DeviceIconProps { type_id: number; } -// matches emsdevice.h DeviceType -const enum DeviceType { - SYSTEM = 0, - TEMPERATURESENSOR, - ANALOGSENSOR, - SCHEDULER, - BOILER, - THERMOSTAT, - MIXER, - SOLAR, - HEATPUMP, - GATEWAY, - SWITCH, - CONTROLLER, - CONNECT, - ALERT, - PUMP, - GENERIC, - HEATSOURCE, - CUSTOM, - UNKNOWN -} - const DeviceIcon: FC = ({ type_id }) => { switch (type_id) { case DeviceType.TEMPERATURESENSOR: diff --git a/interface/src/project/types.ts b/interface/src/project/types.ts index ba668a4e5..5ffffbacb 100644 --- a/interface/src/project/types.ts +++ b/interface/src/project/types.ts @@ -367,3 +367,26 @@ export interface EntityItem { export interface Entities { entities: EntityItem[]; } + +// matches emsdevice.h DeviceType +export const enum DeviceType { + SYSTEM = 0, + TEMPERATURESENSOR, + ANALOGSENSOR, + SCHEDULER, + BOILER, + THERMOSTAT, + MIXER, + SOLAR, + HEATPUMP, + GATEWAY, + SWITCH, + CONTROLLER, + CONNECT, + ALERT, + PUMP, + GENERIC, + HEATSOURCE, + CUSTOM, + UNKNOWN +}