Skip to content

Fix AttributeError when resource disappears from API response - #148

Open
robbybarnes wants to merge 1 commit into
schmittx:mainfrom
robbybarnes:fix-resource-availability-error
Open

Fix AttributeError when resource disappears from API response#148
robbybarnes wants to merge 1 commit into
schmittx:mainfrom
robbybarnes:fix-resource-availability-error

Conversation

@robbybarnes

Copy link
Copy Markdown

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 resource property incorrectly fell back to returning the EeroNetwork object instead of indicating the resource was not found. 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
  • Add available property that returns False when resource is not found, preventing Home Assistant from calling state properties on unavailable entities

Test Plan

  • Deployed to local Home Assistant installation
  • Verified no errors in logs after multiple polling cycles
  • Confirmed integration continues to function normally

Fixes #147

🤖 Generated with Claude Code

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
robbybarnes force-pushed the fix-resource-availability-error branch from 765e157 to d348c8c Compare January 10, 2026 01:24
@PacoCT

PacoCT commented Jan 10, 2026

Copy link
Copy Markdown

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

periodic AttributeError: 'EeroNetwork' object has no attribute 'connected'

2 participants