Skip to content

Commit

Permalink
translate sensor device in web
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDvP committed Jan 5, 2023
1 parent ad680de commit c754d19
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion interface/src/project/DashboardData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ const DashboardData: FC = () => {
const [coreData, setCoreData] = useState<CoreData>({
connected: true,
devices: [],
s_n: '',
active_sensors: 0,
analog_enabled: false
});
Expand Down Expand Up @@ -721,7 +722,7 @@ const DashboardData: FC = () => {
<Cell>
<DeviceIcon type_id={1} />
</Cell>
<Cell>Sensors</Cell>
<Cell>{coreData.s_n}</Cell>
<Cell>{LL.ATTACHED_SENSORS()}</Cell>
<Cell>{coreData.active_sensors}</Cell>
<Cell>
Expand Down
1 change: 1 addition & 0 deletions interface/src/project/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export interface SensorData {
export interface CoreData {
connected: boolean;
devices: Device[];
s_n: string;
active_sensors: number;
analog_enabled: boolean;
}
Expand Down
11 changes: 6 additions & 5 deletions src/locale_translations.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,12 @@ MAKE_PSTR_LIST(solar_device, "Solar Module", "Solarmodul", "Solar Module")
MAKE_PSTR_LIST(connect_device, "Connect Module", "Verbindungsmodul", "Connect Module")
MAKE_PSTR_LIST(mixer_device, "Mixer Module", "Mischermodul", "Mixer Module")
MAKE_PSTR_LIST(controller_device, "Controller Module", "Kontrollmodul", "Controller Module")
MAKE_PSTR_LIST(switch_device, "Switch Module","Schaltmodul","Switch Module")
MAKE_PSTR_LIST(gateway_device, "Gateway Module","Gateway Modul","Gateway Module")
MAKE_PSTR_LIST(alert_device, "Alert Module","Alarmmodul","Alert Module")
MAKE_PSTR_LIST(pump_device, "Pump Module","Pumpenmodul","Pump Module")
MAKE_PSTR_LIST(heatsource_device, "Heatsource","Heizquelle","Heatsource")
MAKE_PSTR_LIST(switch_device, "Switch Module", "Schaltmodul", "Switch Module")
MAKE_PSTR_LIST(gateway_device, "Gateway Module", "Gateway Modul", "Gateway Module")
MAKE_PSTR_LIST(alert_device, "Alert Module", "Alarmmodul", "Alert Module")
MAKE_PSTR_LIST(pump_device, "Pump Module", "Pumpenmodul", "Pump Module")
MAKE_PSTR_LIST(heatsource_device, "Heatsource", "Heizquelle", "Heatsource")
MAKE_PSTR_LIST(sensors_device, "Sensors", "Sensoren", "Sensoren", "Sensorer", "czujniki", "Sensorer", "Capteurs")

// commands
MAKE_PSTR_LIST(info_cmd, "lists all values", "Liste aller Werte")
Expand Down
1 change: 1 addition & 0 deletions src/web/WebDataService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ void WebDataService::core_data(AsyncWebServerRequest * request) {
}

// sensors stuff
root["s_n"] = Helpers::translated_word(FL_(sensors_device));
root["active_sensors"] = EMSESP::dallassensor_.no_sensors() + (EMSESP::analogsensor_.analog_enabled() ? EMSESP::analogsensor_.no_sensors() : 0);
root["analog_enabled"] = EMSESP::analogsensor_.analog_enabled();
root["connected"] = EMSESP::bus_status() != 2;
Expand Down

0 comments on commit c754d19

Please sign in to comment.