Skip to content

Add fire sensors to smhi#153224

Merged
joostlek merged 6 commits into
devfrom
gj-20250929-03
Nov 5, 2025
Merged

Add fire sensors to smhi#153224
joostlek merged 6 commits into
devfrom
gj-20250929-03

Conversation

@gjohansson-ST
Copy link
Copy Markdown
Member

@gjohansson-ST gjohansson-ST commented Sep 29, 2025

Breaking change

Proposed change

Adds fire sensors to SMHI integration
All sensors are disabled by default.

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

  • 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.

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 link to the changelog, or at minimum a diff between library versions 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 fire weather sensors to the SMHI integration, introducing fire risk monitoring capabilities including fire weather indices, moisture codes, and spread indicators. All new fire sensors are disabled by default to prevent overwhelming users with additional entities.

Key Changes:

  • Adds 10 new fire weather sensors with FWI (Fire Weather Index) and related metrics
  • Integrates a new fire forecast API endpoint alongside existing weather data
  • Provides comprehensive fire risk assessment tools for Swedish weather conditions

Reviewed Changes

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

Show a summary per file
File Description
coordinator.py Adds fire forecast API client and data fetching for fire weather metrics
sensor.py Implements 10 new fire sensor entities with proper state classes and device classes
strings.json Adds translations and state mappings for fire weather terminology
icons.json Defines appropriate icons for fire-related sensors
Test files Updates test fixtures and mocks to support fire forecast functionality

Comment thread homeassistant/components/smhi/strings.json Outdated
Copy link
Copy Markdown
Member

@joostlek joostlek left a comment

Choose a reason for hiding this comment

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

One downside is now that we always poll for fire, even if there are none enabled. It would be nice if we could use coordinator context or split coordinators to make sure we don't do that :)

Comment thread homeassistant/components/smhi/sensor.py
Comment thread homeassistant/components/smhi/sensor.py
Comment thread homeassistant/components/smhi/strings.json Outdated
@home-assistant home-assistant Bot marked this pull request as draft October 4, 2025 15:08
@home-assistant
Copy link
Copy Markdown
Contributor

home-assistant Bot commented Oct 4, 2025

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@gjohansson-ST gjohansson-ST marked this pull request as ready for review October 6, 2025 19:16
@home-assistant home-assistant Bot requested a review from joostlek October 6, 2025 19:16
Copy link
Copy Markdown
Member

@joostlek joostlek left a comment

Choose a reason for hiding this comment

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

Other than this LGTM

Comment thread homeassistant/components/smhi/strings.json Outdated
@home-assistant home-assistant Bot marked this pull request as draft November 3, 2025 05:41
@gjohansson-ST gjohansson-ST marked this pull request as ready for review November 4, 2025 19:08
@home-assistant home-assistant Bot requested a review from joostlek November 4, 2025 19:08
@joostlek joostlek merged commit a446d8a into dev Nov 5, 2025
36 checks passed
@joostlek joostlek deleted the gj-20250929-03 branch November 5, 2025 01:37
Comment thread homeassistant/components/smhi/strings.json
@gjohansson-ST gjohansson-ST mentioned this pull request Nov 5, 2025
19 tasks
Comment on lines +48 to +49
"extremely_dry": "Extemely dry",
"moderate_wet": "Moderate wet",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Missed that one earlier:
There is an "r" missing in "Extremely dry", and to match that it should be "Moderately wet"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Gonna blame AI on the missing r 🤣
Gonna blame the Swedish weather institute for not being able to spell out moderately 😛

I'll get it fixed

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

@gjohansson-ST gjohansson-ST mentioned this pull request Nov 6, 2025
19 tasks
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 7, 2025
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.

4 participants