move device types to types.ts

This commit is contained in:
proddy
2023-05-07 09:47:13 +02:00
parent 348ffcd077
commit 3c003657b9
3 changed files with 47 additions and 41 deletions

View File

@@ -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<DeviceIconProps> = ({ type_id }) => {
switch (type_id) {
case DeviceType.TEMPERATURESENSOR: