translate sensor device in web

This commit is contained in:
MichaelDvP
2023-01-05 11:37:00 +01:00
parent ad680de897
commit c754d19015
4 changed files with 10 additions and 6 deletions

View File

@@ -84,6 +84,7 @@ const DashboardData: FC = () => {
const [coreData, setCoreData] = useState<CoreData>({ const [coreData, setCoreData] = useState<CoreData>({
connected: true, connected: true,
devices: [], devices: [],
s_n: '',
active_sensors: 0, active_sensors: 0,
analog_enabled: false analog_enabled: false
}); });
@@ -721,7 +722,7 @@ const DashboardData: FC = () => {
<Cell> <Cell>
<DeviceIcon type_id={1} /> <DeviceIcon type_id={1} />
</Cell> </Cell>
<Cell>Sensors</Cell> <Cell>{coreData.s_n}</Cell>
<Cell>{LL.ATTACHED_SENSORS()}</Cell> <Cell>{LL.ATTACHED_SENSORS()}</Cell>
<Cell>{coreData.active_sensors}</Cell> <Cell>{coreData.active_sensors}</Cell>
<Cell> <Cell>

View File

@@ -102,6 +102,7 @@ export interface SensorData {
export interface CoreData { export interface CoreData {
connected: boolean; connected: boolean;
devices: Device[]; devices: Device[];
s_n: string;
active_sensors: number; active_sensors: number;
analog_enabled: boolean; analog_enabled: boolean;
} }

View File

@@ -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(connect_device, "Connect Module", "Verbindungsmodul", "Connect Module")
MAKE_PSTR_LIST(mixer_device, "Mixer Module", "Mischermodul", "Mixer Module") MAKE_PSTR_LIST(mixer_device, "Mixer Module", "Mischermodul", "Mixer Module")
MAKE_PSTR_LIST(controller_device, "Controller Module", "Kontrollmodul", "Controller Module") MAKE_PSTR_LIST(controller_device, "Controller Module", "Kontrollmodul", "Controller Module")
MAKE_PSTR_LIST(switch_device, "Switch Module","Schaltmodul","Switch 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(gateway_device, "Gateway Module", "Gateway Modul", "Gateway Module")
MAKE_PSTR_LIST(alert_device, "Alert Module","Alarmmodul","Alert Module") MAKE_PSTR_LIST(alert_device, "Alert Module", "Alarmmodul", "Alert Module")
MAKE_PSTR_LIST(pump_device, "Pump Module","Pumpenmodul","Pump Module") MAKE_PSTR_LIST(pump_device, "Pump Module", "Pumpenmodul", "Pump Module")
MAKE_PSTR_LIST(heatsource_device, "Heatsource","Heizquelle","Heatsource") MAKE_PSTR_LIST(heatsource_device, "Heatsource", "Heizquelle", "Heatsource")
MAKE_PSTR_LIST(sensors_device, "Sensors", "Sensoren", "Sensoren", "Sensorer", "czujniki", "Sensorer", "Capteurs")
// commands // commands
MAKE_PSTR_LIST(info_cmd, "lists all values", "Liste aller Werte") MAKE_PSTR_LIST(info_cmd, "lists all values", "Liste aller Werte")

View File

@@ -93,6 +93,7 @@ void WebDataService::core_data(AsyncWebServerRequest * request) {
} }
// sensors stuff // 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["active_sensors"] = EMSESP::dallassensor_.no_sensors() + (EMSESP::analogsensor_.analog_enabled() ? EMSESP::analogsensor_.no_sensors() : 0);
root["analog_enabled"] = EMSESP::analogsensor_.analog_enabled(); root["analog_enabled"] = EMSESP::analogsensor_.analog_enabled();
root["connected"] = EMSESP::bus_status() != 2; root["connected"] = EMSESP::bus_status() != 2;