Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/zxdavb/ramses_rf into eb-…
Browse files Browse the repository at this point in the history
…31da
  • Loading branch information
silverailscolo committed Oct 23, 2024
2 parents 86ceaa5 + c82c7c3 commit f20e349
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ exclude: ^(.secrets|docs|misc|tests/deprecated)/

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.9
rev: v0.7.0
hooks:
- id: ruff # linter
- id: ruff-format # formatter
Expand Down
4 changes: 2 additions & 2 deletions requirements_dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
# - pip list | grep -E 'pre-commit|ruff|mypy|types-|voluptuous|pytest|hatch'

# used for development (linting)
pre-commit >= 3.8.0
ruff >= 0.6.4 # also: check-lint.yml, pre-commit-config.yaml
pre-commit >= 4.0.1
ruff >= 0.7.0 # also: pre-commit-config.yaml

# used for development (typing)
mypy >= 1.11.2
Expand Down
21 changes: 6 additions & 15 deletions src/ramses_tx/parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,22 +256,13 @@ 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": # or: msg.src.type == DEV_TYPE_MAP.OUT:
return {
SZ_TEMPERATURE: hex_to_temp(payload[2:6]),
"_unknown": payload[6:],
}

# if payload[6:] == "02": # msg.src.type == DEV_TYPE_MAP.OUT:
return {
SZ_TEMPERATURE: hex_to_temp(payload[2:6]),
"_unknown": payload[6:],
}
return {"_payload": payload}


# zone_name
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 f20e349

Please sign in to comment.