updates to Translate Device Name #872

This commit is contained in:
proddy
2023-01-05 09:45:33 +01:00
parent cfce36c212
commit bab9fd8ec4
3 changed files with 35 additions and 15 deletions

View File

@@ -1,5 +1,5 @@
{ {
"adapter": "react", "adapter": "react",
"baseLocale": "pl", "baseLocale": "pl",
"$schema": "https://unpkg.com/typesafe-i18n@5.18.1/schema/typesafe-i18n.json" "$schema": "https://unpkg.com/typesafe-i18n@5.18.0/schema/typesafe-i18n.json"
} }

View File

@@ -17,31 +17,52 @@ interface DeviceIconProps {
} }
// matches emsdevice.h DeviceType // matches emsdevice.h DeviceType
const enum DeviceType {
SYSTEM = 0,
DALLASSENSOR,
ANALOGSENSOR,
BOILER,
THERMOSTAT,
MIXER,
SOLAR,
HEATPUMP,
GATEWAY,
SWITCH,
CONTROLLER,
CONNECT,
ALERT,
PUMP,
GENERIC,
HEATSOURCE,
UNKNOWN
}
const DeviceIcon: FC<DeviceIconProps> = ({ type_id }) => { const DeviceIcon: FC<DeviceIconProps> = ({ type_id }) => {
switch (type_id) { switch (type_id) {
case 1: case DeviceType.DALLASSENSOR:
case 2: case DeviceType.ANALOGSENSOR:
return <MdOutlineSensors />; return <MdOutlineSensors />;
case 3: case DeviceType.BOILER:
case DeviceType.HEATSOURCE:
return <CgSmartHomeBoiler />; return <CgSmartHomeBoiler />;
case 4: case DeviceType.THERMOSTAT:
return <MdThermostatAuto />; return <MdThermostatAuto />;
case 5: case DeviceType.MIXER:
return <AiOutlineControl />; return <AiOutlineControl />;
case 6: case DeviceType.SOLAR:
return <FaSolarPanel />; return <FaSolarPanel />;
case 7: case DeviceType.HEATPUMP:
return <GiHeatHaze />; return <GiHeatHaze />;
case 8: case DeviceType.GATEWAY:
return <AiOutlineGateway />; return <AiOutlineGateway />;
case 9: case DeviceType.SWITCH:
return <TiFlowSwitch />; return <TiFlowSwitch />;
case 10: case DeviceType.CONTROLLER:
case 11: case DeviceType.CONNECT:
return <VscVmConnect />; return <VscVmConnect />;
case 12: case DeviceType.ALERT:
return <AiOutlineAlert />; return <AiOutlineAlert />;
case 13: case DeviceType.PUMP:
return <AiOutlineChrome />; return <AiOutlineChrome />;
default: default:
return null; return null;

View File

@@ -245,7 +245,6 @@ StateUpdateResult WebSettings::update(JsonObject & root, WebSettings & settings)
#ifndef EMSESP_STANDALONE #ifndef EMSESP_STANDALONE
if (!old_local.equals(settings.locale)) { if (!old_local.equals(settings.locale)) {
add_flags(ChangeFlags::RESTART); // force restart add_flags(ChangeFlags::RESTART); // force restart
// add_flags(ChangeFlags::MQTT);
} }
#endif #endif