mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 16:59:50 +03:00
translate sensor device in web
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
@@ -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;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ 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")
|
||||||
|
|||||||
@@ -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;
|
||||||
|
|||||||
Reference in New Issue
Block a user