diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 929ac07e..1ab79a68 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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 diff --git a/requirements_dev.txt b/requirements_dev.txt index 09421f2d..90a90802 100644 --- a/requirements_dev.txt +++ b/requirements_dev.txt @@ -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 diff --git a/src/ramses_tx/parsers.py b/src/ramses_tx/parsers.py index ee747fad..2fda8645 100644 --- a/src/ramses_tx/parsers.py +++ b/src/ramses_tx/parsers.py @@ -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 diff --git a/src/ramses_tx/ramses.py b/src/ramses_tx/ramses.py index 6984afde..016bde6b 100644 --- a/src/ramses_tx/ramses.py +++ b/src/ramses_tx/ramses.py @@ -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 diff --git a/tests/tests/parsers/code_0002.log b/tests/tests/parsers/code_0002.log new file mode 100644 index 00000000..2bc29693 --- /dev/null +++ b/tests/tests/parsers/code_0002.log @@ -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 #