]> vcs.slashdirt.org Git - sw/tic2json.git/commitdiff

vcs.slashdirt.org Git - sw/tic2json.git/commitdiff

git git / sw / tic2json.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 401d5e6)
tools/ticprocess.py: publish power
Thu, 7 Dec 2023 10:49:50 +0000 (11:49 +0100)
Thu, 7 Dec 2023 10:50:13 +0000 (11:50 +0100)

diff --git a/tools/ticprocess.py b/tools/ticprocess.py
index 349b40d6af339b7b40bc39183e82550f14b5ec41..d2cf1fe1423e77376684374952dd6a9f5efd11c8 100755 (executable)
--- a/tools/ticprocess.py
+++ b/tools/ticprocess.py
@@ -30,6 +30,7 @@ MQTT_TOPIC_ALLOWDHW = "sensors/switch/dhwt" # topic MQTT ECS OK, 1 if "RELAIS" =
MQTT_TOPIC_DAYCOLOR = "tic/color" # -, B, W, R
MQTT_TOPIC_NDAYCOLOR = "tic/ncolor" # -, B, W, R
MQTT_TOPIC_DAYHC = "tic/hc" # 1 if HC, 0 otherwise (HP)
+MQTT_TOPIC_POWER = "tic/power"
MQTT_SKIP = 8 # nombre de trames à ignorer entre chaque publication MQTT
ETIQ_POWER = "SINSTS" # en mono: TICv1: "PAPP", TICv2: "SINSTS"
ETIQ_MSG = "MSG1" # MSG1: message court (32c), MSG2: message ultra court (16c)
@@ -117,6 +118,8 @@ for ticjsonline in sys.stdin:
edhwok = allow_edhw(tic)
dayhc = day_hc(tic)
colors = tempo_colors(tic)
+ p = tic.get(ETIQ_POWER)
+ p = p and p.get("data")
mqttmsgs = [
( MQTT_TOPIC_DELEST, delest, 0, False),
@@ -124,6 +127,7 @@ for ticjsonline in sys.stdin:
( MQTT_TOPIC_DAYHC, dayhc, 0, False),
( MQTT_TOPIC_DAYCOLOR, colors[0], 0, False),
( MQTT_TOPIC_NDAYCOLOR, colors[1], 0, False),
+ ( MQTT_TOPIC_POWER, p, 0, False),
]
if not skip:
tic2json TIC parser/converter
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /