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",
"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
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 }) => {
switch (type_id) {
case 1:
case 2:
case DeviceType.DALLASSENSOR:
case DeviceType.ANALOGSENSOR:
return <MdOutlineSensors />;
case 3:
case DeviceType.BOILER:
case DeviceType.HEATSOURCE:
return <CgSmartHomeBoiler />;
case 4:
case DeviceType.THERMOSTAT:
return <MdThermostatAuto />;
case 5:
case DeviceType.MIXER:
return <AiOutlineControl />;
case 6:
case DeviceType.SOLAR:
return <FaSolarPanel />;
case 7:
case DeviceType.HEATPUMP:
return <GiHeatHaze />;
case 8:
case DeviceType.GATEWAY:
return <AiOutlineGateway />;
case 9:
case DeviceType.SWITCH:
return <TiFlowSwitch />;
case 10:
case 11:
case DeviceType.CONTROLLER:
case DeviceType.CONNECT:
return <VscVmConnect />;
case 12:
case DeviceType.ALERT:
return <AiOutlineAlert />;
case 13:
case DeviceType.PUMP:
return <AiOutlineChrome />;
default:
return null;

View File

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