Closed piitaya closed 1 month ago
The pull request introduces significant structural changes to the icons.json
file in the custom_components/huesyncbox
, transitioning from a flat icon mapping to a hierarchical categorization by entity types. This includes detailed attributes for number
, select
, sensor
, and switch
categories. Additionally, icon attributes have been removed from various entity descriptions in the number.py
, select.py
, sensor.py
, and switch.py
files, indicating a shift in icon management and representation.
File | Change Summary |
---|---|
custom_components/huesyncbox/icons.json |
Expanded structure to categorize icons by entity types (number , select , sensor , switch ) with default and state-specific icons; modified services section. |
custom_components/huesyncbox/number.py |
Removed icon attribute from HueSyncBoxNumberEntityDescription for "brightness." |
custom_components/huesyncbox/select.py |
Removed icon attributes from HueSyncBoxSelectEntityDescription for "hdmi_input," "entertainment_area," "intensity," and "led_indicator_mode." |
custom_components/huesyncbox/sensor.py |
Removed icons attribute, WIFI_STRENGTH_ICONS dictionary, and icon property method from HueSyncBoxSensorEntityDescription . |
custom_components/huesyncbox/switch.py |
Removed icon attributes from HueSyncBoxSwitchEntityDescription for "power," "light_sync," and "dolby_vision_compatibility." |
sensor.py
file regarding the HueSyncBoxSensorEntityDescription
class are related to the main PR, as both involve modifications to the handling of sensor entities, specifically in how icons and attributes are managed.🐰 In the land of hues and sync,
Icons dance and blink,
From flat to grand they rise,
A structured feast for eyes!
With every switch and sensor bright,
A joyful hop, a new delight! 🌈
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Thanks for the contribution.
There is a test failing that was checking the Wifi strength icons. The line with the check on the icon can be removed since icons are now handled by the translation system (I think)
I would prefer to keep the icon for Syncmode since the movie/music/game ones differ too much and while it does represent the current Syncmode it does not represent Syncmode itself (for which I could not find an icon yet, so that is why it is still default Select entity).
I think the entity icon should primarily represent the entity and should only use enhanced versions of the base icon for state specific versions so it stays clear what entity it represents.
E.g. the Wifi icon is always a Wifi icon, just more or less bars. Similar for the LED icons, it is always an LED, but off/dimmed/on
Thank you for the review. I adjusted the code according to your feedback 🙂
What do you think about this icon for the sync mode?
I also found these ones.
If none is good for you, we can keep the default one for now 🙂
I like the multimedia one. Lets go with that.
Use icon translations introduced few months ago (https://developers.home-assistant.io/blog/2024/01/19/icon-translations/)
Summary by CodeRabbit
New Features
Bug Fixes
Refactor