Fix AttributeError when resource disappears from API response - #148
Open
robbybarnes wants to merge 1 commit into
Open
Fix AttributeError when resource disappears from API response#148robbybarnes wants to merge 1 commit into
robbybarnes wants to merge 1 commit into
Conversation
When a client or profile temporarily disappears from the Eero API response (e.g., device disconnects), the `resource` property would incorrectly fall back to returning the `EeroNetwork` object. This caused AttributeError exceptions because EeroNetwork doesn't have attributes like `connected` that exist on EeroClient/EeroProfile. Changes: - Fix `resource` property to return `None` when a resource_id is set but the resource cannot be found in the network's resources list - Add `available` property that returns `False` when resource is not found, which prevents Home Assistant from calling state properties on unavailable entities This fixes the recurring error: AttributeError: 'EeroNetwork' object has no attribute 'connected' Fixes schmittx#147 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
robbybarnes
force-pushed
the
fix-resource-availability-error
branch
from
January 10, 2026 01:24
765e157 to
d348c8c
Compare
|
Thanks, @robbybarnes |
mikesten
added a commit
to mikesten/home-assistant-eero
that referenced
this pull request
Aug 12, 2026
…from API Adopted from robbybarnes via schmittx#148 (unmerged upstream). Stops entities silently falling back to network-level data when their resource vanishes; they now report unavailable instead. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes the recurring
AttributeError: 'EeroNetwork' object has no attribute 'connected'error that occurs when devices/clients temporarily disappear from the Eero API response.Root Cause: When a client or profile disappears from the API response (e.g., device disconnects), the
resourceproperty incorrectly fell back to returning theEeroNetworkobject instead of indicating the resource was not found. This causedAttributeErrorexceptions becauseEeroNetworkdoesn't have attributes likeconnectedthat exist onEeroClient/EeroProfile.Changes:
resourceproperty to returnNonewhen aresource_idis set but the resource cannot be foundavailableproperty that returnsFalsewhen resource is not found, preventing Home Assistant from calling state properties on unavailable entitiesTest Plan
Fixes #147
🤖 Generated with Claude Code