Skip to content

Add error and alert sensors to Fumis integration#169307

Merged
edenhaus merged 1 commit into
devfrom
frenck-2026-0445
Apr 29, 2026
Merged

Add error and alert sensors to Fumis integration#169307
edenhaus merged 1 commit into
devfrom
frenck-2026-0445

Conversation

@frenck
Copy link
Copy Markdown
Member

@frenck frenck commented Apr 27, 2026

Proposed change

Add error and alert enum sensors to the Fumis integration. These sensors show the currently active error or alert on the stove, with the original device error code (like E101 or A001) available as a state attribute.

  • When no error/alert is active, the sensor shows "No error" / "No alert"
  • When an unknown code is received, the sensor shows as unknown
  • Each state has a contextual icon (fire, door, temperature sensor, etc.)

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

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:

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

This PR adds diagnostic enum sensors to the Fumis integration to expose the stove’s currently active error and alert states (with the original device code exposed via a state attribute).

Changes:

  • Add new alert and error enum sensors in the Fumis sensor platform, including a code extra attribute.
  • Add translations and state-specific icons for the new enum sensor states.
  • Extend test coverage with new fixtures/snapshots and an additional test for active error/alert codes.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
homeassistant/components/fumis/sensor.py Adds alert/error enum sensors and helper functions to map library codes to HA enum states + extra attributes.
homeassistant/components/fumis/strings.json Adds localized names and state strings for the new enum sensors.
homeassistant/components/fumis/icons.json Adds default and state-specific icons for alert/error states.
tests/components/fumis/test_sensor.py Adds a new test for active error/alert sensors and updates conditional entity creation expectations.
tests/components/fumis/snapshots/test_sensor.ambr Updates snapshots to include the new sensors and their states/attributes.
tests/components/fumis/fixtures/info_error_alert.json Adds a fixture representing a device reporting an active error and alert.

assert state.state == "low_fuel"
assert state.attributes["code"] == "A001"


Copy link

Copilot AI Apr 27, 2026

Choose a reason for hiding this comment

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

Add a test case that feeds an unmapped/unknown alert/error code and asserts the enum sensor state becomes unknown (and the code attribute behaves as intended) to cover the PR’s stated behavior for unknown codes.

Suggested change
@pytest.mark.parametrize("device_fixture", ["info_unknown_error_alert"])
@pytest.mark.usefixtures("entity_registry_enabled_by_default", "init_integration")
async def test_sensors_unknown_error_and_alert(
hass: HomeAssistant,
entity_registry: er.EntityRegistry,
) -> None:
"""Test error and alert sensors with unmapped codes."""
error_entity_id = entity_registry.async_get_entity_id(
"sensor", "fumis", f"{UNIQUE_ID}_error"
)
assert error_entity_id is not None
assert (error_state := hass.states.get(error_entity_id))
assert error_state.state == STATE_UNKNOWN
assert error_state.attributes["code"] == "E999"
alert_entity_id = entity_registry.async_get_entity_id(
"sensor", "fumis", f"{UNIQUE_ID}_alert"
)
assert alert_entity_id is not None
assert (alert_state := hass.states.get(alert_entity_id))
assert alert_state.state == STATE_UNKNOWN
assert alert_state.attributes["code"] == "A999"

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member

@edenhaus edenhaus left a comment

Choose a reason for hiding this comment

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

Thanks @frenck 👍

@edenhaus edenhaus merged commit a7baedc into dev Apr 29, 2026
37 checks passed
@edenhaus edenhaus deleted the frenck-2026-0445 branch April 29, 2026 07:51
@github-actions github-actions Bot locked and limited conversation to collaborators Apr 30, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants