Skip to content

Fluss/fix offline device crash#172833

Open
Marcello17 wants to merge 5 commits into
home-assistant:devfrom
fluss:fluss/fix-offline-device-crash
Open

Fluss/fix offline device crash#172833
Marcello17 wants to merge 5 commits into
home-assistant:devfrom
fluss:fluss/fix-offline-device-crash

Conversation

@Marcello17
Copy link
Copy Markdown
Contributor

@Marcello17 Marcello17 commented Jun 2, 2026

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's status/{deviceId} call failed, the exception was raised as UpdateFailed, 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-api client now maps that to a dedicated FlussDeviceOfflineError (and categorizes 404 → FlussDeviceError).

The coordinator now handles per-device status failures individually:

  • 503 / offline → the device is kept and marked internetConnected: False, so its entities show as unavailable but the device stays visible.
  • Any other per-device error → that device is skipped for this refresh; the remaining devices load normally.

A total failure of the device-list call still raises UpdateFailed / ConfigEntryError as before.

Requires fluss-api==0.2.5.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

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

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to frontend pull request:

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

Copilot AI review requested due to automatic review settings June 2, 2026 12:47
@home-assistant home-assistant Bot added bugfix cla-signed dependency Pull requests marked as a dependency upgrade has-tests integration: fluss small-pr PRs with less than 30 lines. Quality Scale: bronze labels Jun 2, 2026
@home-assistant
Copy link
Copy Markdown
Contributor

home-assistant Bot commented Jun 2, 2026

Hey there @fluss, mind taking a look at this pull request as it has been labeled with an integration (fluss) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of fluss can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant mark-draft Mark the pull request as draft.
  • @home-assistant ready-for-review Remove the draft status from the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign fluss Removes the current integration label and assignees on the pull request, add the integration domain after the command.
  • @home-assistant update-branch Update the pull request branch with the base branch.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) to the pull request.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component, problem in config, problem in device, feature-request) on the pull request.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 FlussDeviceOfflineError and skip devices whose status cannot be fetched.
  • Adjust coordinator data-building to omit devices with failed status fetches.
  • Add/adjust tests and bump fluss-api from 0.2.4 to 0.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 thread homeassistant/components/fluss/coordinator.py
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
}
Comment thread homeassistant/components/fluss/coordinator.py Outdated
Copy link
Copy Markdown
Contributor

@c00w c00w left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix cla-signed dependency Pull requests marked as a dependency upgrade has-tests integration: fluss Quality Scale: bronze small-pr PRs with less than 30 lines.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants