Skip to content

_on_attribute/apply_states: unguarded indigo.devices[dev_id] can KeyError if a device is deleted out-of-band #84

Description

@simons-plugins

Pre-existing (not introduced by PR #80, but #80's meter links add one more path that reaches it): device_sync.py _on_attribute/apply_states do indigo.devices[dev_id] unguarded (:1376, :1390) — the try/except wraps only handler.on_attribute_update, not the dict lookup. If a device is deleted out-of-band while its node (or forward-linked source endpoint) keeps reporting, this raises an uncaught KeyError per event until reconcile. Other sites in the same file guard the same pattern (:1300, :1358). Fix: same guard + debug log, all sites.

Found during PR #80's test-coverage review.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Arj5R66d73tc3PMPvHS65Z

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions