V2 phase1 architecture - #232
Conversation
…ening - Vended OWNd natively, bypassing legacy PyPI constraints. - Deprecated myhome.yaml in favor of dynamic UI Active Discovery. - Added full MediaPlayerEntity support for WHO=16 Audio Matrix. - Implemented strict 120s asyncio.wait_for watchdogs on Event sessions to stop silent failures. - Integrated Exponential Backoff reconnection handling to guard the gateway from DDoS. - Throttled high-load polling intervals on standard sensors. - Resolved NoneType startup crashes, routing into native ConfigEntryNotReady.
- test_lighting.py: 32 tests covering all timer/dimmer/blinker/motion/PIR states - test_automation.py: 14 tests covering cover open/close/stop/position logic - test_heating.py: 31 tests covering all HVAC modes, temperatures, offsets, valves - test_gateway_messages.py: 73 tests covering gateway, alarm, aux, CEN, CEN+, scene, energy, dry contacts, signaling, and parse routing - pyproject.toml: Disable pytest-socket and HA plugin interference - conftest.py: Shared test configuration
…(315 tests) - test_connection.py: 28 tests covering OWNGateway, OWNSession props, HMAC SHA1/SHA256 encode/decode, legacy password hashing, hex/int conversions - test_message_edges.py: 137 tests covering every remaining branch across heating modes, valve/actuator states, alarm codes, aux events, CEN+ rotations, gateway device types, energy sensors, lighting dimensions, AV commands, and full WHO command routing
… total) - test_platforms.py: 17 tests covering MyHOMEEntity base, MediaPlayer state transitions, source selection, volume control, command dispatch, and platform setup/unload - test_message_edges.py: 137 edge-case tests for remaining message.py branches - test_connection.py: 28 tests for OWNGateway + HMAC crypto helpers - Total: 332 tests, 0 failures
…assistant-custom-component - pyproject.toml: Restored -p no:socket - tests/conftest.py: Configured auto_enable_custom_integrations fixture - tests/test_init.py: async_setup_entry + unload via MockConfigEntry - tests/test_config_flow.py: Full manual config flow validation - tests/test_platforms_integration.py: Complete platform dynamic discovery and dispatch routing testing for light, climate, cover, sensor, binary_sensor, media_player, and switch
- Fix test_init.py listening_loop/sending_loop patch targets - Add unique_id to mock config to avoid dr.format_mac crash - Fix config_flow.py using 'with' instead of 'async with' for async_timeout
- Add missing MyHOMEGatewayHandler import in __init__.py - Sync patch targets in test_platforms_integration.py to listening_loop/sending_loop - Mock find_gateways in test_config_flow.py to bypass socket constraints natively block by pytest_socket
…overy keys to MockConfigEntry - Fix test_config_flow.py where async_init triggered discovery before mock context - Add ssdp, firmware, manufacturer keys to MockConfigEntry data maps to avoid KeyError in MyHOMEGatewayHandler constructor
- Change result['step_id'] to result['flow_id'] in async_configure calls - Fix lowercase 'udn' payload key to 'UDN' to match const.CONF_UDN - Fix 'friendlyName' metadata to 'friendly_name' to match HA constants
…mport - Config flow user step expects 'serial' key only, not host/port/password - Tests now follow: user -> custom -> test_connection flow - Add missing CONF_HOST import to __init__.py (NameError on line 68)
- async_setup_entry calls gateway.test(), which validates the connection via OWNSession.test_connection()
- Previously, tests mocked the internal OWN{Event|Command}Session.connect() which incorrectly allowed test_connection to attempt a real socket connection, causing SocketBlockedError/ConfigError during test_init.py and platform setup tests.
…ming, climate fan support, exception handling, and dispatcher safeties)
…s, and test registry lookup
…d hass injections
…syrupy, state machine verification)
…n, Climate, Sensor
…mit and test isolation
…ustive edge-case test suites
…d updated test counts
|
@GreenGrassBlueOcean Current version detected my light/motion sensor, but does not interpret the related frames. |
|
Hi @anotherjulien, Thank you for reporting this and verifying with your live plant! We investigated the codebase and protocol handling, and your observation is 100% spot-on:
|
|
Hey @anotherjulien, huge thanks for catching this and providing the exact frame details ( The fix has been implemented with 100% test coverage and merged into
Thanks again for the invaluable testing and feedback! |
|
Thanks @GreenGrassBlueOcean ! However, I now have a similar issue with dry contacts. It also seems the motion/light sensor device is not updated correctly, for instance these frames: Do not trigger any value update, the sensor stays |
…eprecations (#242) - Validate gateway clock fields and handle optional/missing timezones - Drain complete command replies through terminal ACK/NACK with 30s timeout - Restore and route discovered WHO 18 energy & power measurements without aliasing - Support Home Assistant via_device_id and remove deprecated MediaPlayerState.STANDBY - Full test pass across 836 unit tests with 100% ownd core coverage
…-gateway-mcp repository
|
Hi @anotherjulien, Thank you so much for testing on live Legrand hardware and providing the exact frame logs! The captured traces ( We have diagnosed both issues:
We have tracked this in dedicated issue #247 (#247). We are implementing the fix with full test coverage directly on this PR branch! 🚀 |
…egister scenario devices - Filter device triggers by scenario address/object to prevent whole-house trigger collision - Auto-register CEN (WHO 15) and CEN+ (WHO 25) units in device_registry under gateway - Prevent empty device pruning from removing scenario devices on HA startup - Reject lights/covers from showing irrelevant CEN triggers in automation UI - Align pacing terminology in README and ROADMAP to adaptive inter-frame queue delay - Add 9 new unit tests across device triggers, gateway events, and pruning (855 passing)
|
@GreenGrassBlueOcean just to clarify, the
So when you have either A or PL above 9, you cannot have a 3 digit APL, must be 4 digits. ALso, getting real nitpicky: in my old code, I created the WHO 14 buttons with entity IDs ending specifically with |
Summary of Changes in v2 Phase 1 Architecture
This PR delivers the complete Phase 1 Architecture Modernization for the OpenWebNet MyHOME integration, providing rock-solid stability, full Home Assistant Core 2025/2026 compatibility, support for modern and legacy gateways, USB/Serial transport for Legrand 3578, an in-band real-time Lovelace bus monitor card, full feature parity (dry contacts, virtual cover positioning, burglar alarm, fancoil climate), and 100% automated test coverage across all components.
Key Architectural Pillars & Feature Parity
Dual Asynchronous Transports (TCP & Serial/USB):
AsyncTcpTransportandAsyncSerialTransport(pyserial-asyncio) sharing a unified stream interface.Declarative Gateway Profiles & Adaptive Pacing:
MH200/MH201/MH202,F454/F455,MyHomeServer1, and3578.Stream Framing & Sentinel Watchdog:
readuntil(b"##")framing, eliminating malformed chunk parsing and race conditions.hmac.compare_digest.Home Assistant Core 2025/2026 Compatibility & Resiliency:
__call__hooks (2026.9 root cause: HA replaced voluptuous with probatio, which skips __call__ on nested Schema subclasses #230).myhome.yaml(/config/myhome.yaml->/config/myhome/myhome.yaml-> custom components directory).self.config_entryassignment inOptionsFlowHandler.ENERGY_WATT_HOUR,POWER_WATT,TEMP_CELSIUS) with modern HA unit enums.Full Feature Parity for Stage 1:
OWNDryContactEvent,OWNDryContactCommand) and AUX channels (OWNAuxEvent).travel_time(interpolated during motion), target positioning (set_cover_position) with auto-stop background task, and native WHO=2 dimension 10 support.alarm_control_panel): Complete alarm platform supportingARM_AWAY,ARM_HOME,DISARM, andTRIGGERcommands, global broadcast zone 0 listening alongside partition addressing, and dynamic zone discovery.auto,low,medium,high) using OpenWebNet dimension 11, immediate startup status sweep on entity addition, and local offset tracking.Lovelace Bus Monitor Card (
<myhome-bus-card>):Quality & Test Coverage:
Resolved Issues
Closes #30
Closes #69
Closes #80
Closes #92
Closes #103
Closes #105
Closes #110
Closes #115
Closes #116
Closes #117
Closes #118
Closes #121
Closes #123
Closes #127
Closes #132
Closes #134
Closes #136
Closes #139
Closes #143
Closes #146
Closes #147
Closes #150
Closes #151
Closes #152
Closes #156
Closes #157
Closes #159
Closes #161
Closes #162
Closes #165
Closes #166
Closes #168
Closes #170
Closes #172
Closes #174
Closes #176
Closes #177
Closes #178
Closes #179
Closes #181
Closes #185
Closes #188
Closes #190
Closes #191
Closes #194
Closes #200
Closes #203
Closes #205
Closes #212
Closes #213
Closes #215
Closes #219
Closes #220
Closes #230
Closes #231
Closes #233
Closes #234