Skip to content

fix: catch all exceptions during Zigbee device enrichment#751

Merged
CFenner merged 2 commits intoopenviess:masterfrom
lackas:fix/enrichment-exception-handling
Apr 28, 2026
Merged

fix: catch all exceptions during Zigbee device enrichment#751
CFenner merged 2 commits intoopenviess:masterfrom
lackas:fix/enrichment-exception-handling

Conversation

@lackas
Copy link
Copy Markdown
Contributor

@lackas lackas commented Apr 28, 2026

Summary

  • Broaden exception handling in __enrichZigbeeDevices() from specific exceptions to Exception
  • Fixes crash when a RoomControl device is offline (PyViCareDeviceCommunicationError: GATEWAY_OFFLINE)

Motivation

#743 added Zigbee device enrichment from RoomControl. The enrichment runs during __loadInstallations(), so any unhandled exception crashes the entire client initialization. The original except only caught KeyError, IndexError, and PyViCareNotSupportedFeatureError, but offline devices throw PyViCareDeviceCommunicationError.

Since enrichment is best-effort (errors are logged with traceback, the device is skipped, and initialization continues), catching Exception is appropriate here.

Test plan

  • All 733 existing tests pass
  • Reported by @CFenner on his setup with an offline RoomControl device

lackas added 2 commits April 28, 2026 22:29
GATEWAY_OFFLINE (PyViCareDeviceCommunicationError) was not caught,
crashing client initialization when a RoomControl device is offline.
Enrichment is best-effort and should never prevent startup.
@CFenner CFenner added the bugfix label Apr 28, 2026
@CFenner CFenner merged commit 630bbea into openviess:master Apr 28, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants