Skip to content

Commit

Permalink
tweak 0002 (wip)
Browse files Browse the repository at this point in the history
  • Loading branch information
zxdavb committed Oct 23, 2024
1 parent 225965b commit 84c011e
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/ramses_tx/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,23 +256,14 @@ def parser_0001(payload: str, msg: Message) -> Mapping[str, bool | str | None]:

# outdoor_sensor (outdoor_weather / outdoor_temperature)
def parser_0002(payload: str, msg: Message) -> dict[str, Any]:
# seen with: 03:125829, 03:196221, 03:196196, 03:052382, 03:201498, 03:201565:
# .I 000 03:201565 --:------ 03:201565 0002 004 03020105 # no zone_idx, domain_id

# is it CODE_IDX_COMPLEX:
# - 02...... for outside temp?
# - 03...... for other stuff?

if msg.src.type == DEV_TYPE_MAP.HCW: # payload[2:] == DEV_TYPE_MAP.HCW, DEX
assert payload == "03020105"
return {"_unknown": payload}

# if payload[6:] == "02": # msg.src.type == DEV_TYPE_MAP.OUT:
if payload[6:] == "02": # or: msg.src.type == DEV_TYPE_MAP.OUT:
return {

Check failure on line 260 in src/ramses_tx/parsers.py

View workflow job for this annotation

GitHub Actions / lint (3.12)

Ruff

src/ramses_tx/parsers.py:260:5: SyntaxError: Expected an indented block after `if` statement
SZ_TEMPERATURE: hex_to_temp(payload[2:6]),
"_unknown": payload[6:],
}

return {"_payload": payload}


# zone_name
def parser_0004(payload: str, msg: Message) -> PayDictT._0004:
Expand Down
3 changes: 3 additions & 0 deletions src/ramses_tx/ramses.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
W_: r"^(0[0-9A-F]|FC|FF)000005(01|05)$",
}, # TODO: there appears to be a dodgy? RQ/RP for UFC
Code._0002: { # WIP: outdoor_sensor - CODE_IDX_COMPLEX?
# is it CODE_IDX_COMPLEX:
# - 02...... for outside temp?
# - 03...... for other stuff?
SZ_NAME: "outdoor_sensor",
I_: r"^0[0-4][0-9A-F]{4}(00|01|02|05)$", # Domoticz sends ^02!!
RQ: r"^00$", # NOTE: sent by an RFG100
Expand Down
8 changes: 8 additions & 0 deletions tests/tests/parsers/code_0002.log
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# seen with: 03:125829, 03:196221, 03:196196, 03:052382, 03:201498, 03:201565: ?no idx
2024-01-01T00:00:00.000000 067 I 000 03:201565 --:------ 03:201565 0002 004 03020105 #
2021-11-25T19:58:23.426059 061 I 000 03:196221 --:------ 03:196221 0002 004 03020105


# ClimaRad Ventura V1x, only [4:6] 12 and 18 seen
2024-01-01T00:00:00.000000 063 I --- 37:153226 --:------ 37:153226 0002 004 00120005 #
2024-01-01T00:00:00.000000 063 I --- 37:153226 --:------ 37:153226 0002 004 00180005 #

0 comments on commit 84c011e

Please sign in to comment.