Volume entities (sound): dynamic icon update #11406
Unanswered
dougiteixeira
asked this question in
Other feature requests
Replies: 2 comments 6 replies
-
@frenck, do you think i can implement this? Thanks! |
Beta Was this translation helpful? Give feedback.
3 replies
-
We do something similar for battery icons already, but I am not sure right now if that is driven by the backend or the frontend. If frontend then probably based on the |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I would like to propose this change, as it interferes with the core, I preferred to open a discussion before creating a PR (I created the PR home-assistant/core#64803 later).
The suggestion consists of create
icon_for_volume_level()
so that the volume entities icon is dynamically updated from the entity value. It also considers a possible mute or do not disturb entity that may exist for the device.The initial idea came from the objective of defining the icon of entities of similar volume with the battery level (entities number when there is volume control on the device and sensor entity when there is only volume feedback), but there is no class of devices for this (in sensor entities it doesn't exist and number entities are not yet supported). I realized that defining the icon is possible even without a class directly in the core, defining it in each integration, but the ideal of this
icon_for_volume_level
class is to be in the core.Changes:
Additions to the
homeassistant/helpers/icon.py
file:Screenshots of the various conditions:
Volume level 71-100% and not muted:
Volume level 36-70% and not muted:
Volume level 1-35% and not muted:
Volume level 0% and not muted:
Volume level 0-100% and muted:
Beta Was this translation helpful? Give feedback.
All reactions