From bb9b45c261c787ebddb83c4e5bbd01a0ca80c488 Mon Sep 17 00:00:00 2001 From: denpamusic Date: Sun, 24 Dec 2023 02:25:31 +0300 Subject: [PATCH 1/3] sync strings.json Add missing lines from the "en.json". --- custom_components/econet300/strings.json | 25 +++++++++++++------ .../econet300/translations/en.json | 2 +- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/custom_components/econet300/strings.json b/custom_components/econet300/strings.json index 60f25e1..246dfe3 100644 --- a/custom_components/econet300/strings.json +++ b/custom_components/econet300/strings.json @@ -33,24 +33,33 @@ }, "sensor": { "boiler_power": { "name": "Boiler power" }, - "temp_external_sensor": { "name": "Outside temperature" }, - "temp_feeder": {"name": "Feeder temperature"}, "fuel_level": { "name": "Fuel level" }, - "thermostat": { "name": "Thermostat" }, + "fan_power": { "name": "Fan power" }, + "fan_works": { "name": "Fan" }, "lambda_status": { "name": "Lambda status" }, "lambda_set": { "name": "Lambda set" }, "lambda_level": { "name": "Lambda level" }, + "main_server": { "name": "Main server" }, + "mode": { "name": "Boiler mode" }, + "mixer_temp1": { "name": "Mixer 1 temperature" }, + "mixer_set_temp1": { "name": "Mixer target temperature" }, + "pump_cwu_works": { "name": "HUW pump" }, + "pump_fireplace_works": { "name": "Boiler pump" }, "signal": { "name": "Signal quality" }, + "servo_mixer1": { "name": "Mixer 1 servo position" }, + "status_wifi": { "name": "Wireless network connected" }, "temp_co": { "name": "Heating temperature" }, "temp_cwu": { "name": "Water heater temperature" }, "temp_upper_buffer": { "name": "Upper buffer temperature" }, "temp_lower_buffer": { "name": "Lower buffer temperature" }, "temp_flue_gas": { "name": "Flue gas temperature" }, - "mixer_temp1": { "name": "Mixer 1 temperature" }, - "mixer_set_temp1": { "name": "Mixer target temperature" }, - "mode": { "name": "Boiler mode" }, - "fan_power": { "name": "Fan power" }, - "temp_co_set": { "name": "Heating target temperature" } + "temp_external_sensor": { "name": "Outside temperature" }, + "temp_feeder": {"name": "Feeder temperature"}, + "temp_co_set": { "name": "Heating target temperature" }, + "thermostat": { "name": "Thermostat" }, + "unseal": { "name": "Unseal" }, + "valve_mixer1": { "name": "Mixer 1 valve % open" }, + "weather_control": {"name": "Weather control the boiler"} } } } diff --git a/custom_components/econet300/translations/en.json b/custom_components/econet300/translations/en.json index 36078f2..9ce61a1 100644 --- a/custom_components/econet300/translations/en.json +++ b/custom_components/econet300/translations/en.json @@ -62,4 +62,4 @@ "weather_control": {"name": "Weather control the boiler"} } } -} \ No newline at end of file +} From 02e581135bc0042d99ce6e67153348ac9add5163 Mon Sep 17 00:00:00 2001 From: denpamusic Date: Sun, 24 Dec 2023 02:33:12 +0300 Subject: [PATCH 2/3] add strings for boiler mode This allows to translate boiler mode. --- custom_components/econet300/const.py | 46 ++++++++++--------- custom_components/econet300/strings.json | 20 +++++++- .../econet300/translations/en.json | 20 +++++++- .../econet300/translations/pl.json | 20 +++++++- 4 files changed, 82 insertions(+), 24 deletions(-) diff --git a/custom_components/econet300/const.py b/custom_components/econet300/const.py index ce9410b..7bd2aa6 100644 --- a/custom_components/econet300/const.py +++ b/custom_components/econet300/const.py @@ -45,20 +45,20 @@ ## Boiler staus keys map # boiler mode names from endpoint http://LocalIP/econet/rmParamsEnums? OPERATION_MODE_NAMES = { - 0: "TURNED OFF", - 1: "FIRE UP", - 2: "FIRE UP", - 3: "WORK", - 4: "SUPERVISION", - 5: "Halted", - 6: "STOP", - 7: "BURNING OFF", - 8: "MANUAL", - 9: "ALARM", - 10: "UNSEALING", - 11: "CHIMNEY", - 12: "STABILIZATION", - 13: "NO TRANSMISSION", + 0: "off", + 1: "fire_up", + 2: "fire_up", + 3: "work", + 4: "supervision", + 5: "halted", + 6: "stop", + 7: "burning_off", + 8: "manual", + 9: "alarm", + 10: "unsealing", + 11: "chimney", + 12: "stabilization", + 13: "no_transmission", } # add constants to future @@ -254,13 +254,17 @@ } ENTITY_VALUE_PROCESSOR = { - "mode": lambda x: OPERATION_MODE_NAMES.get(x, "Unknown"), - "thermostat": lambda x: "ON" - if str(x).strip() == "true" - else ("OFF" if str(x).strip() == "false" else None), - "lambdaStatus": lambda x: "STOP" - if x == 0 - else ("START" if x == 1 else ("Working" if x == 2 else "Unknown")), + "mode": lambda x: OPERATION_MODE_NAMES.get(x, "unknown"), + "thermostat": ( + lambda x: "ON" + if str(x).strip() == "true" + else ("OFF" if str(x).strip() == "false" else None) + ), + "lambdaStatus": ( + lambda x: "STOP" + if x == 0 + else ("START" if x == 1 else ("Working" if x == 2 else "Unknown")) + ), "status_wifi": lambda x: "Connected" if x == 1 else "Disconnected", "main_server": lambda x: "Server available" if x == 1 else "Server not available", } diff --git a/custom_components/econet300/strings.json b/custom_components/econet300/strings.json index 246dfe3..874f599 100644 --- a/custom_components/econet300/strings.json +++ b/custom_components/econet300/strings.json @@ -40,7 +40,25 @@ "lambda_set": { "name": "Lambda set" }, "lambda_level": { "name": "Lambda level" }, "main_server": { "name": "Main server" }, - "mode": { "name": "Boiler mode" }, + "mode": { + "name": "Boiler mode", + "state": { + "off": "[%key:common::state::off%]", + "fire_up": "Fire up", + "work": "Work", + "supervision": "Supervision", + "halted": "Halted", + "stop": "Stop", + "burning_off": "Burning off", + "manual": "Manual", + "alarm": "Alarm", + "unsealing": "Unsealing", + "chimney": "Chimney", + "stabilization": "Stabilization", + "no_transmission": "No transmission", + "unknown": "Unknown" + } + }, "mixer_temp1": { "name": "Mixer 1 temperature" }, "mixer_set_temp1": { "name": "Mixer target temperature" }, "pump_cwu_works": { "name": "HUW pump" }, diff --git a/custom_components/econet300/translations/en.json b/custom_components/econet300/translations/en.json index 9ce61a1..bcba107 100644 --- a/custom_components/econet300/translations/en.json +++ b/custom_components/econet300/translations/en.json @@ -40,7 +40,25 @@ "lambda_set": { "name": "Lambda set" }, "lambda_level": { "name": "Lambda level" }, "main_server": { "name": "Main server" }, - "mode": { "name": "Boiler mode" }, + "mode": { + "name": "Boiler mode", + "state": { + "off": "Off", + "fire_up": "Fire up", + "work": "Work", + "supervision": "Supervision", + "halted": "Halted", + "stop": "Stop", + "burning_off": "Burning off", + "manual": "Manual", + "alarm": "Alarm", + "unsealing": "Unsealing", + "chimney": "Chimney", + "stabilization": "Stabilization", + "no_transmission": "No transmission", + "unknown": "Unknown" + } + }, "mixer_temp1": { "name": "Mixer 1 temperature" }, "mixer_set_temp1": { "name": "Mixer target temperature" }, "pump_cwu_works": { "name": "HUW pump" }, diff --git a/custom_components/econet300/translations/pl.json b/custom_components/econet300/translations/pl.json index 4efcc98..1049005 100644 --- a/custom_components/econet300/translations/pl.json +++ b/custom_components/econet300/translations/pl.json @@ -42,7 +42,25 @@ "mixer_temp1": { "name": "Temp. mieszacza 1" }, "mixer_set_temp1": { "name": "Temp. zadana mieszacza 1" }, "main_server": { "name": "Główny serwer" }, - "mode": { "name": "Tryb pracy" }, + "mode": { + "name": "Tryb pracy", + "state": { + "off": "Off", + "fire_up": "Fire up", + "work": "Work", + "supervision": "Supervision", + "halted": "Halted", + "stop": "Stop", + "burning_off": "Burning off", + "manual": "Manual", + "alarm": "Alarm", + "unsealing": "Unsealing", + "chimney": "Chimney", + "stabilization": "Stabilization", + "no_transmission": "No transmission", + "unknown": "Unknown" + } + }, "pump_cwu_works": { "name": "HUW pump" }, "pump_fireplace_works": { "name": "Boiler pump" }, "valve_mixer1": { "name": "Zawór mieszacza 1" }, From 3355517a2d8ed06fee4dd9459bc2db95353e46fd Mon Sep 17 00:00:00 2001 From: denpamusic Date: Sun, 24 Dec 2023 02:42:07 +0300 Subject: [PATCH 3/3] add strings for lambda status --- custom_components/econet300/const.py | 4 ++-- custom_components/econet300/strings.json | 10 +++++++++- custom_components/econet300/translations/en.json | 10 +++++++++- custom_components/econet300/translations/pl.json | 10 +++++++++- 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/custom_components/econet300/const.py b/custom_components/econet300/const.py index 7bd2aa6..49f1d22 100644 --- a/custom_components/econet300/const.py +++ b/custom_components/econet300/const.py @@ -261,9 +261,9 @@ else ("OFF" if str(x).strip() == "false" else None) ), "lambdaStatus": ( - lambda x: "STOP" + lambda x: "stop" if x == 0 - else ("START" if x == 1 else ("Working" if x == 2 else "Unknown")) + else ("start" if x == 1 else ("working" if x == 2 else "unknown")) ), "status_wifi": lambda x: "Connected" if x == 1 else "Disconnected", "main_server": lambda x: "Server available" if x == 1 else "Server not available", diff --git a/custom_components/econet300/strings.json b/custom_components/econet300/strings.json index 874f599..7025ca6 100644 --- a/custom_components/econet300/strings.json +++ b/custom_components/econet300/strings.json @@ -36,7 +36,15 @@ "fuel_level": { "name": "Fuel level" }, "fan_power": { "name": "Fan power" }, "fan_works": { "name": "Fan" }, - "lambda_status": { "name": "Lambda status" }, + "lambda_status": { + "name": "Lambda status", + "state": { + "stop": "Stop", + "start": "Start", + "working": "Working", + "unknown": "Unknown" + } + }, "lambda_set": { "name": "Lambda set" }, "lambda_level": { "name": "Lambda level" }, "main_server": { "name": "Main server" }, diff --git a/custom_components/econet300/translations/en.json b/custom_components/econet300/translations/en.json index bcba107..94f5a80 100644 --- a/custom_components/econet300/translations/en.json +++ b/custom_components/econet300/translations/en.json @@ -36,7 +36,15 @@ "fuel_level": { "name": "Fuel level" }, "fan_power": { "name": "Fan power" }, "fan_works": { "name": "Fan" }, - "lambda_status": { "name": "Lambda status" }, + "lambda_status": { + "name": "Lambda status", + "state": { + "stop": "Stop", + "start": "Start", + "working": "Working", + "unknown": "Unknown" + } + }, "lambda_set": { "name": "Lambda set" }, "lambda_level": { "name": "Lambda level" }, "main_server": { "name": "Main server" }, diff --git a/custom_components/econet300/translations/pl.json b/custom_components/econet300/translations/pl.json index 1049005..d8fe0a3 100644 --- a/custom_components/econet300/translations/pl.json +++ b/custom_components/econet300/translations/pl.json @@ -36,7 +36,15 @@ "fuel_level": { "name": "Poziom paliwa" }, "fan_works": { "name": "Fan" }, "fan_power": { "name": "Moc nadmuchu" }, - "lambda_status": { "name": "Lambda status" }, + "lambda_status": { + "name": "Lambda status", + "state": { + "stop": "Stop", + "start": "Start", + "working": "Working", + "unknown": "Unknown" + } + }, "lambda_set": { "name": "Lambda set" }, "lambda_level": { "name": "Czujnik Lambda" }, "mixer_temp1": { "name": "Temp. mieszacza 1" },