Movind mdi and icon color logic back into python?

Currently components can set their icon in python by setting the icon property. A few components are using this, though there are some defaults for setting this icons that happen fully in polymer - https://github.com/sdague/home-assistant-polymer/blob/44ed827145879dd12e20183be75a2af9594240a1/src/util/hass-util.html#L219-L322

One thing that can only be done on the polymer side is the changing the color of the mdi icon, which is used for RGB bulbs - https://github.com/sdague/home-assistant-polymer/blob/44ed827145879dd12e20183be75a2af9594240a1/src/components/entity/state-badge.html#L76-L86

It would be really nice to get this functionality back onto the python side. For instance, changing the color of thermometer icons based on the temperature. Potentially having an icon_color attribute that could be reflected up. The default logic could be put back into base classes.

Is there an interest in this change to open this up?

10 Likes