Repository navigation
Conversation
own-firmware-oracle who13-clock: `*OpenWebNet-HA#13**#0*14*30*00*0530##` is ACKed and echoed on the event session by nine gateways (F454, F459 NACK; MyHomeServer1 silent), `…*124##` by eleven, and the F450 reports the stored `0530` on later reads (who13-clock-readback). `_gateway_timezone` raised ValueError on both and the exception left the event session. The two measured values define two bounded classes, a four-digit value with a sign digit and a three-digit negative offset of 24 h or more. Their layout and meaning are unverified, so `timezone` is None (unknown), never "" (local time), `raw_timezone` keeps the value, and the time / datetime are naive. `200`, `099`, `2000`, `05300` and the like still raise (MyHOME tests/test_gateway_regressions.py pins `099` and `200`). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by A
Summary
*#13**#0*14*30*00*0530##and...*124##are clock writes whose timezone value is not the documentedSHHform: a four-digit value with a sign digit (0530) and a three-digit negative offset of 24 h or more (124). Most gateways ACK such writes and echo them on the event session, and the F450 reports the stored0530on later reads._gateway_timezoneraisedValueError: Invalid gateway timezone: '0530'on the first and, for124,datetime.timezonerefused a 24 h offset; the exception propagated out of the event-session parse.What the values mean is not verified by any capture (an ACK and an echo prove that the gateway stores the value, not what it means), so this PR decodes them as unknown (
timezone is None), never as local time (""), and keepsraw_timezoneas sent. Split out of #138.Changes
OWNd/message/gateway.py:_UNMAPPED_TIMEZONE_REGEX = [01][0-9]{3}|1(?:2[4-9]|[3-9][0-9]), the two classes the measured values belong to, bounded by the sign digit and the length (0000..1999) and by the first negative offsetdatetime.timezonecannot hold (124..199;123is still-23:00)._gateway_timezonereturnsNonefor them (type nowstr | None); the fourfromisoformatcall sites useself._timezone or "", so the parsedtime/datetimeare naive.raw_timezonekeeps the value;is_timezone_unconfiguredstaysFalse(that is the999sentinel). Thetimezoneproperty docstring says whatNonemeans. This covers both the echo of a write (OWNGatewayCommand,*#13**#0*...##and*#13**#22*...##) and the read reply (OWNGatewayEvent, dimensions 0 and 22).200,099,024,2,12,2000,9999,2400,05300,00530. MyHOME'stests/test_gateway_regressions.py:41(test_malformed_gateway_clock_fields_are_rejected) requires*#13**0*15*00*00*200##and...*099##to keep raising; they do.CHANGELOG.md: entry under[Unreleased]/Fixed.MyHOME does not read
OWNGatewayEvent.timezoneorraw_timezone(custom_components/myhomeatv2-phase1-architecture: no consumer), soNonereaches no integration code today; a future consumer gets "unknown", not "local".State Diagram
stateDiagram-v2 direction TB state "_gateway_timezone(values[3]) for *#13**0*HH*MM*SS*T## and the #0 / #22 / 22 forms" as TZ { [*] --> Classify Classify --> Local : or 999\ntimezone , unchanged Classify --> Offset : SHH, S in 0/1, HH 00..23\n+02 -00 / -23 -00 , unchanged Classify --> Unknown : 0000..1999 , sign + three digits, 0530 measured\nor 124..199 ,24 h or more, 124 measured\ntimezone None, raw_timezone kept, naive time , new - before - ValueError out of the event session Classify --> Rejected : 200, 099, 024, 2000, 05300, ...\nValueError , unchanged }Where are the traces
No physical trace applies:
0530and124were written only by the oracle harness. The live F461 2.0.11 and MyHomeServer1 3.87.13 report time zone999(*#13**0*...*999##, trace PROpenWebNet-HA/MyHOME#799, merged), which parsed before and after.What does the Oracle say
Suite
who13-clock,results/<P>/<V>/oracle/full/who13-clock.tsv:ack/out(echoed on the event session)ack/silentnack/silent-/silent*#13**#0*14*30*00*0530##020010, F453010100, F453AV030014, F460020012, F461020011, H4684020054, MH200020102, MH200N010108, MH202010024(9)020051, F459020105028206*#13**#0*14*30*00*124##020105(10)020051(ACK, no echo)028206*#13**#22*14*30*00*0530*03*21*10*2026##028206F453, F453AV, H4684, MH200 and MH200N also put the clock on the bus (
bus:columns). Suitewho13-clock-readback(findings/who13-clock.md, "Read-back after a write"): after*#13**#0*14*30*00*0530##the F450 reportsT=0530on later reads, "the only firmware that echoes a non-standard offset back"; F454 and F459 keep102because they NACKed0530. So both the echo path (OWNGatewayCommand) and the reply path (OWNGatewayEvent) need the tolerance. No row says what the gateway does with the value, henceNone.Testing
tests/test_who13_clock_echo_timezones.py(new, 32 cases): the#0and#22echoes with0530/124parse asOWNGatewayCommandwithtimezone is None,raw_timezoneas sent,is_timezone_unconfigured False, a naive 14:30:00 and the date kept; the dimension 0 and 22 replies with0530/124parse asOWNGatewayEventthe same way; five unmeasured members of the two classes (0000,1999,1240,125,199) areNonetoo; eleven values outside them still raise (200,099,024,2,12,2000,9999,2400,05300,00530); whole-hour offsets000..123still decode (123is-23:00);999and empty still mean local time.master14 fail, 18 pass (0530raisesInvalid gateway timezone;124raises thetimedeltarange error); on this branch all 32 pass.1939 passed, 1 skipped(master:1907 passed, 1 skipped); 100 % statement coverage,mypyclean (str | Noneend to end),ruffclean,scripts/sync_documentation.py --checkandscripts/verify_library_standards.pypass.Live retest (2026-10-24)
Not exercised live: both plants report
999; no0530/124was written to a real gateway (clock writes on a real home were out of scope).Companion
None. Split from #138 (
#-prefixed dimension 14 setpoints).🤖 Generated with Claude Code