Skip to content

Fixes remote icon state color#11698

Merged
bramkragten merged 1 commit intohome-assistant:devfrom
joshmcrty:fix-remote-state-icon-color
Feb 16, 2022
Merged

Fixes remote icon state color#11698
bramkragten merged 1 commit intohome-assistant:devfrom
joshmcrty:fix-remote-state-icon-color

Conversation

@joshmcrty
Copy link
Copy Markdown
Contributor

The <ha-state-icon> component does not show the correct state color for the remote domain when the "color icons by state" option is turned on in Lovelace cards. This fixes that bug.

Proposed change

This adds a CSS selector to include the remote domain when coloring an icon based on its state in Lovelace. Currently if a remote is "on" and a Lovelace card is configured to color the icons by state (i.e. yellow icon when "on"), the icon does not change color when the state changes. It is always the same color as it would be when "off."

Current behavior:
Screen Shot 2022-02-15 at 1 44 38 PM

New behavior:
Screen Shot 2022-02-15 at 1 46 56 PM

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Example configuration

Set up a remote integration, such as a Logitech Harmony Hub or smart tv. Add a Lovelace entity/entities/glance card and display the remote entity. Toggle on the option to change icon color based on state. It should now turn yellow (with the default theme) when the remote is on and back to the default color when off.

type: entity
entity: remote.family_room
state_color: true

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue or discussion:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

The ha-state--icon does not show the correct state color for the remote domain when the "color icons by state" option is turned on in lovelace cards. This fixes that bug.
@bramkragten bramkragten merged commit f43655e into home-assistant:dev Feb 16, 2022
@joshmcrty joshmcrty deleted the fix-remote-state-icon-color branch February 17, 2022 14:43
@github-actions github-actions bot locked and limited conversation to collaborators Feb 18, 2022
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.

3 participants