What's Changed
π Persistent TCP Connection
This release upgrades to the latest version of pyasyncialarm, which introduces a persistent TCP connection to the alarm panel. The connection is now kept open across requests and automatically re-established if it drops, with one transparent retry before surfacing an error.
In practice this means:
- Fewer TCP handshakes per poll cycle
- No more
unavailablestate caused byOSErrorduring socket receive - More resilient behaviour when the panel is slow or temporarily unreachable
π Bug Fixes
- Zone sensor false positives β
_has_alarmand_has_anomalyflags are now reset at the start of every coordinator update cycle. Previously, once a zone triggered an alarm or anomaly, the sensor would remain in that state even after the zone returned to normal. CANCELstate now mapped correctly β when the panel returnsDevStatus=3(cancel/clear), the alarm control panel entity now showsdisarmedinstead of an unknown/unavailable state.async_shutdowncloses the socket β the coordinator now callsialarm_device.shutdown()when Home Assistant stops, ensuring the TCP connection is cleanly closed instead of being left open.
β¨ Improvements
- Smarter disarm sequence β
async_alarm_disarmnow usesdisarm_and_cancel()from the library, which reads theDevStatusfrom the panel response and only retriescancel_alarmif the panel is still in a triggered state. The previous fixedasyncio.sleep(2)has been removed. - Device trigger
cancelβ a new device trigger is available for automations: fires when the alarm alerts are canceled via the dedicated button. DOMAINno longer hardcoded indevice_trigger.pyβ imported fromconst.pyto avoid silent drift if the domain name changes.- Redundant
async_set_updated_datacall removed from_async_update_datain the coordinator. - Residual
hass.data.setdefaultremoved from__init__.pyβ leftover from an older integration pattern, superseded byconfig_entry.runtime_data.
π¦ Dependencies
- Requires the new version of
pyasyncialarmwith persistent TCP connection support.
Full Changelog: v1.2.0...v2.0.0