Skip to content

Add per-span time windows for best-price sensors - #24

Merged
adnansarajlic merged 2 commits into
mainfrom
Fix-Sensors
Mar 28, 2026
Merged

adnansarajlic merged 2 commits into
mainfrom
Fix-Sensors

Conversation

@adnansarajlic

Copy link
Copy Markdown
Owner

Introduce per-span time restrictions for "best price" sensors. Added utils.parse_spans to parse span strings like "1, 3[22:00-06:00], 6" (returns (span, start, end)), and updated binary_sensor to use parsed spans and pass span-specific restrict_start/restrict_end to each sensor (falling back to global config when not provided). Updated README, translations and changelog, bumped manifest version to 1.1.9, and extended tests (parse_spans unit tests and coordinator test for span-specific restriction precedence). Warnings are logged for invalid span or time formats.

Introduce per-span time restrictions for "best price" sensors. Added utils.parse_spans to parse span strings like "1, 3[22:00-06:00], 6" (returns (span, start, end)), and updated binary_sensor to use parsed spans and pass span-specific restrict_start/restrict_end to each sensor (falling back to global config when not provided). Updated README, translations and changelog, bumped manifest version to 1.1.9, and extended tests (parse_spans unit tests and coordinator test for span-specific restriction precedence). Warnings are logged for invalid span or time formats.
Remove extraneous trailing spaces and blank lines in custom_components/tibber-extended/utils.py and tests (tests/test_coordinator.py, tests/test_utils.py). Adjust minor formatting in imports and list/tuple spacing in tests. No functional changes were made; this is purely whitespace/style cleanup.
@adnansarajlic
adnansarajlic merged commit 29621c2 into main Mar 28, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant