Fluss/fix offline device crash#172833
Open
Marcello17 wants to merge 5 commits into
Open
Conversation
Contributor
|
Hey there @fluss, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates the Fluss integration to better tolerate per-device status failures (including a new “device offline” case) while keeping the config entry loaded, and bumps the fluss-api dependency accordingly.
Changes:
- Add handling for
FlussDeviceOfflineErrorand skip devices whose status cannot be fetched. - Adjust coordinator data-building to omit devices with failed status fetches.
- Add/adjust tests and bump
fluss-apifrom0.2.4to0.2.5.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
homeassistant/components/fluss/coordinator.py |
Treat offline as a synthetic status and skip devices when status fetch fails. |
homeassistant/components/fluss/manifest.json |
Bump integration requirement to fluss-api==0.2.5. |
requirements_all.txt |
Bump pinned dependency to fluss-api==0.2.5. |
tests/components/fluss/test_init.py |
Add tests for offline vs. failed per-device status during setup. |
tests/components/fluss/test_cover.py |
Update test docstring to reflect new behavior wording. |
Comment on lines
78
to
82
| return { | ||
| device["deviceId"]: {**device, **status} | ||
| for device, status in zip(device_list, statuses, strict=False) | ||
| if status is not None | ||
| } |
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.
Proposed change
The issue is the
▎characters and-->. That's a quoted/blockquote artifact. Here's a clean version for the PR description:The Fluss+ coordinator fetches each device's status concurrently with
asyncio.gather. Previously, if any single device'sstatus/{deviceId}call failed, the exception was raised asUpdateFailed, which aborted the whole gather and failed the entire config entry setup (ConfigEntryNotReady→ "Failed setup, will retry"). One offline device took down every Fluss device on the account.The Fluss API returns HTTP 503 "Device is not connected to the internet" for an offline device. The bundled
fluss-apiclient now maps that to a dedicatedFlussDeviceOfflineError(and categorizes 404 →FlussDeviceError).The coordinator now handles per-device status failures individually:
internetConnected: False, so its entities show as unavailable but the device stays visible.A total failure of the device-list call still raises
UpdateFailed/ConfigEntryErroras before.Requires
fluss-api==0.2.5.Type of change
Additional information
▎ Bumps fluss-api 0.2.4 → 0.2.5. Changelog:
▎ - Add FlussDeviceOfflineError (raised on HTTP 503 "Device is not connected to the internet").
▎ - Categorize HTTP status codes on status/{deviceId}: 404 → FlussDeviceError, 503 → FlussDeviceOfflineError.
▎ - All FlussApiClientError subclasses now propagate instead of being re-wrapped as a generic error.
▎ - Release: https://github.com/fluss/Fluss_Python_Library/releases/tag/v0.2.5
Change log: fluss/Fluss_Python_Library@v0.2.4...v0.2.5
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: