Skip to content

Commit

Permalink
updates to Translate Device Name #872
Browse files Browse the repository at this point in the history
  • Loading branch information
proddy committed Jan 5, 2023
1 parent cfce36c commit bab9fd8
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 15 deletions.
2 changes: 1 addition & 1 deletion interface/.typesafe-i18n.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"adapter": "react",
"baseLocale": "pl",
"$schema": "https://unpkg.com/[email protected].1/schema/typesafe-i18n.json"
"$schema": "https://unpkg.com/[email protected].0/schema/typesafe-i18n.json"
}
47 changes: 34 additions & 13 deletions interface/src/project/DeviceIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
1 change: 0 additions & 1 deletion src/web/WebSettingsService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit bab9fd8

Please sign in to comment.