Add binary sensor to Nord Pool#169684
Open
gjohansson-ST wants to merge 2 commits intodevfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR extends the Nord Pool integration by adding a new diagnostic binary sensor that indicates whether tomorrow’s prices are available, along with coordinator support and test coverage for the new platform.
Changes:
- Add a
binary_sensorplatform with atomorrow_price_availablediagnostic entity per configured area. - Extend the coordinator with a helper to access tomorrow’s delivery period data.
- Update Nord Pool tests and snapshots to load platforms selectively and validate the new binary sensor behavior.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| homeassistant/components/nordpool/binary_sensor.py | Adds the new diagnostic binary sensor platform and entity implementation. |
| homeassistant/components/nordpool/coordinator.py | Adds get_data_tomorrow() accessor used by the binary sensor. |
| homeassistant/components/nordpool/const.py | Registers the binary_sensor platform in PLATFORMS. |
| homeassistant/components/nordpool/strings.json | Adds the binary sensor translation key/name. |
| tests/components/nordpool/conftest.py | Adds platform patching fixture to load only selected platforms per test. |
| tests/components/nordpool/test_sensor.py | Ensures sensor tests load only the sensor platform. |
| tests/components/nordpool/test_binary_sensor.py | Adds snapshot tests for binary sensor on/off scenarios. |
| tests/components/nordpool/snapshots/test_sensor.ambr | Updates snapshot names due to new parametrization. |
| tests/components/nordpool/snapshots/test_binary_sensor.ambr | Adds snapshots for the new binary sensor entities. |
8 tasks
Member
|
"Tomorrow price available as diagnostic sensor", would it it be odd to expect an update in the diagnostics ambr file? :) |
zweckj
reviewed
May 3, 2026
| ) -> bool: | ||
| """Return tomorrow price availability. | ||
|
|
||
| Output: True or False |
Member
There was a problem hiding this comment.
Suggested change
| Output: True or False |
It's a bool return type that is obvious
| Output: True or False | ||
| """ | ||
| data = entity.coordinator.get_data_tomorrow() | ||
| if data and data.entries and entity.area in data.entries[0].entry: |
Member
There was a problem hiding this comment.
Suggested change
| if data and data.entries and entity.area in data.entries[0].entry: | |
| return (data and data.entries and entity.area in data.entries[0].entry) |
A bit more concise imo
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.
Breaking change
Proposed change
Adds binary sensor to Nord Pool
Type of change
Additional information
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: