Improve/fix Insteon event handling#168663
Improve/fix Insteon event handling#168663gogglespisano wants to merge 9 commits intohome-assistant:devfrom
Conversation
This fixes bug home-assistant#162946. Insteon sensor events are missing the data about the event. In the case of the leak sensor, the heartbeat event looked the same regardless of whether it was from the device heartbeat or the heartbeat manager missed heartbeat event. This needs pyinsteon pull request pyinsteon/pyinsteon#442 in order to have the full data in the event. This also cleans up the event names by removed the redundant "event" suffix on most of the events and also simplifies the event processing code. Both the existing events and the new events without the "event" suffix are fired for compatibility with existing automations. A deprecation warning is added to the event data.
There was a problem hiding this comment.
It seems you haven't yet signed a CLA. Please do so here.
Once you do that we will be able to review and accept this pull request.
Thanks!
|
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
|
Hey there @teharris1, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
There was a problem hiding this comment.
Pull request overview
Improves Insteon event handling by propagating additional low-level event details into Home Assistant events and introducing cleaner event names (without the redundant _event suffix) while attempting to preserve backward compatibility.
Changes:
- Refactors Insteon event firing to enrich event payloads (battery/heartbeat/moisture/button).
- Implements “new” event names (suffix removed) and also fires legacy events with a deprecation notice.
- Updates Insteon constants to support the new event payload fields.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
homeassistant/components/insteon/utils.py |
Refactors event subscription and HA event firing, adds new event payload fields and legacy event emission. |
homeassistant/components/insteon/const.py |
Removes old button event constants and adds new event payload field keys. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
gogglespisano
left a comment
There was a problem hiding this comment.
Made the suggested code changes
rename heartbeat to heartbeat_missed. make a legacy copy of the event schema. only send legacy event if it's different from new event.
Proposed change
Insteon sensor events are missing the data about the event.
This change passes the lower level event data into the HA event.
In the case of the leak sensor, the heartbeat event looked the same regardless of whether it was from the device heartbeat or the heartbeat manager missed heartbeat event, resulting in the heartbeat state never changing to "Problem" when the heartbeat is missed.
This also cleans up the event names by removed the redundant "event" suffix on most of the events and also simplifies the event processing code.
Both the existing events and the new events without the "event" suffix are fired for backwards compatibility with existing automations. A deprecation warning is added to the event data.
Type of change
Additional information
Checklist
ruff format homeassistant tests)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest.requirements_all.txt.Updated by running
python3 -m script.gen_requirements_all.To help with the load of incoming pull requests: