Skip to content

Commit

Permalink
Merge pull request #47 from denpaforks/dev-1.0.0-beta
Browse files Browse the repository at this point in the history
Translatable boiler mode and lambda states
  • Loading branch information
jontofront authored Dec 25, 2023
2 parents d7ecbdc + 3355517 commit ef76f65
Show file tree
Hide file tree
Showing 4 changed files with 126 additions and 35 deletions.
46 changes: 25 additions & 21 deletions custom_components/econet300/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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",
}
Expand Down
53 changes: 44 additions & 9 deletions custom_components/econet300/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,59 @@
},
"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" },
"lambda_status": { "name": "Lambda status" },
"fan_power": { "name": "Fan power" },
"fan_works": { "name": "Fan" },
"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" },
"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" },
"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"}
}
}
}
32 changes: 29 additions & 3 deletions custom_components/econet300/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,37 @@
"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" },
"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" },
Expand All @@ -62,4 +88,4 @@
"weather_control": {"name": "Weather control the boiler"}
}
}
}
}
30 changes: 28 additions & 2 deletions custom_components/econet300/translations/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,39 @@
"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" },
"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" },
Expand Down

0 comments on commit ef76f65

Please sign in to comment.