Skip to content

Comments

feat: support for color thresholds in forecast chart#43

Merged
troinine merged 15 commits intomainfrom
feature/use-color-thresholds
Dec 30, 2025
Merged

feat: support for color thresholds in forecast chart#43
troinine merged 15 commits intomainfrom
feature/use-color-thresholds

Conversation

@troinine
Copy link
Owner

This PR adds support for color thresholds for temperature lines in the forecast chart mode. Colors can be customized via themes. Sensible defaults are used with fixed intervals.

Copy link
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 introduces support for temperature-based color gradients in forecast chart mode, allowing temperature lines to dynamically transition through different colors based on temperature values. The feature is opt-in via a new use_color_thresholds configuration option.

  • Adds gradient coloring for temperature lines with predefined thresholds at -10°, 0°, 8°, 18°, 26°, and 34° (Celsius)
  • Introduces six new CSS variables for customizing temperature threshold colors (cold, freezing, chilly, mild, warm, hot)
  • Implements dashed line style for low temperature when color thresholds are enabled for better visual distinction

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
src/components/wfc-forecast-chart.ts Implements gradient computation logic and temperature line styling with threshold-based colors
src/types.ts Adds use_color_thresholds boolean option to forecast configuration interface
src/weather-forecast-card.css Defines six new CSS variables for temperature color thresholds with sensible defaults
src/editor/weather-forecast-card-editor.ts Adds UI configuration option and helper text for the new feature
README.md Documents the new feature, configuration option, and theme variables with detailed descriptions
demo/index.html Enables color thresholds in the demo and adds apparent_temperature to displayed attributes
test/weather-forecast-chart.test.ts Adds comprehensive test suite for gradient functionality, line styles, and CSS variable customization
test/mocks/test-data.ts Adds Fahrenheit test data with conversion utility for temperature unit testing
test/mocks/hass.ts Adds unit of measurement support and apparent temperature calculation to mock
test/app/index.html Adds visual test cases for color thresholds in both Celsius and Fahrenheit

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

troinine and others added 7 commits December 30, 2025 22:55
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Tero Roininen <troinine@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Tero Roininen <troinine@users.noreply.github.com>
Copy link
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

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

troinine and others added 2 commits December 31, 2025 00:27
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Tero Roininen <troinine@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Tero Roininen <troinine@users.noreply.github.com>
@troinine troinine merged commit 44871e6 into main Dec 30, 2025
3 checks passed
@troinine troinine deleted the feature/use-color-thresholds branch December 30, 2025 22:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant