Skip to content

Commit

Permalink
Use consts
Browse files Browse the repository at this point in the history
  • Loading branch information
bieniu committed Nov 21, 2024
1 parent 041e0fd commit 6ab2438
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python_scripts/shellies_discovery_gen2.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@
TPL_TEMPERATURE_INDEPENDENT = "{{value_json.tC}}"
TPL_BTH_SENSOR = "{{value_json.value}}"
TPL_BTH_BINARY_SENSOR = "{{^ON^ if value_json.value else ^OFF^}}"
TPL_BLU_THERMOSTAT_ACTION = "{%if value_json.pos>0%}heating{%else%}idle{%endif%}"
TPL_BLU_THERMOSTAT_MODE = "{{^off^ if value_json.value==4 else ^heat^}}"
TPL_THERMOSTAT_MODE = "{{%if value_json.enable%}}{action}{{%else%}}off{{%endif%}}"
TPL_UPTIME = "{{(as_timestamp(now())-value_json.sys.uptime)|timestamp_local}}"
Expand Down Expand Up @@ -3201,8 +3202,8 @@ def get_blu_climate(

payload = {
KEY_NAME: "",
KEY_ACTION_TOPIC: f"~status/blutrv:{thermostat_id}/trv",
KEY_ACTION_TEMPLATE: "{%if value_json.pos>0%}heating{%else%}idle{%endif%}",
KEY_ACTION_TOPIC: TOPIC_STATUS_BLU_TRV_TRV.format(id=thermostat_id),
KEY_ACTION_TEMPLATE: TPL_BLU_THERMOSTAT_ACTION,
KEY_CURRENT_TEMPERATURE_TOPIC: TOPIC_STATUS_BTH_SENSOR.format(
id=temperature_id
),
Expand Down

0 comments on commit 6ab2438

Please sign in to comment.