mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
updates to Translate Device Name #872
This commit is contained in:
@@ -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"
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user