Skip to content

Comments

feat: support for displaying current weather attributes#34

Merged
troinine merged 17 commits intomainfrom
feature/show-current-weather-attributes
Dec 25, 2025
Merged

feat: support for displaying current weather attributes#34
troinine merged 17 commits intomainfrom
feature/show-current-weather-attributes

Conversation

@troinine
Copy link
Owner

This PR adds support to both, the card and its editor, for weather entity attributes. The feature mimics the built-in weather entity more-info dialog by its design.

Configured attributes are rendered if available in the weather entity. List of attributes extracted from https://www.home-assistant.io/integrations/weather/

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 adds support for displaying current weather attributes in the weather forecast card, mimicking the Home Assistant built-in weather entity more-info dialog. The feature allows users to configure which weather attributes (like humidity, pressure, wind speed, etc.) are displayed below the current weather conditions.

Key Changes

  • Added configuration interface for selecting weather attributes to display (boolean, single attribute, or array of attributes)
  • Implemented new component wfc-current-weather-attributes to render configured attributes with icons and formatted values
  • Extended editor with multi-select dropdown for choosing weather attributes

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
src/types.ts Added CURRENT_WEATHER_ATTRIBUTES constant and CurrentWeatherAttributes type, plus WeatherForecastCardCurrentConfig interface
src/data/weather.ts Exported WeatherEntityAttributes interface and added getWind() function with cardinal direction formatting
src/components/wfc-current-weather.ts Updated to conditionally render weather attributes based on configuration
src/components/wfc-current-weather-attributes.ts New component to render individual weather attributes with icons, labels, and formatted values
src/editor/weather-forecast-card-editor.ts Added editor support for selecting weather attributes via multi-select dropdown
src/weather-forecast-card.css Added styling for weather attributes display with flexbox layout
test/mocks/ha-attribute-icon.ts New mock component for rendering attribute icons in tests
test/mocks/hass.ts Added localization strings for weather attributes and cardinal directions, plus formatEntityAttributeValue mock
test/mocks/index.ts New index file exporting all mocks
test/current-weather-attributes.test.ts Added test coverage for weather attributes rendering
test/app/index.html Added test card demonstrating weather attributes feature
README.md Documented new current.show_attributes configuration option
package.json & pnpm-lock.yaml Added @mdi/js dependency for test icons
demo/index.html Updated import path for MockHass
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

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

troinine and others added 9 commits December 25, 2025 18:17
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 14 out of 15 changed files in this pull request and generated 2 comments.

Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

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

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Tero Roininen <troinine@users.noreply.github.com>
@troinine troinine merged commit fc89017 into main Dec 25, 2025
3 checks passed
@troinine troinine deleted the feature/show-current-weather-attributes branch December 25, 2025 19:12
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