{"action":"created","issue":{"url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/issues/1074","repository_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer","labels_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/issues/1074/labels{/name}","comments_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/issues/1074/comments","events_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/issues/1074/events","html_url":"https://github.com/home-assistant/home-assistant-polymer/pull/1074","id":312125341,"number":1074,"title":"Allow setting a custom state-badge icon color","user":{"login":"NovapaX","id":411716,"avatar_url":"https://avatars3.githubusercontent.com/u/411716?v=4","gravatar_id":"","url":"https://api.github.com/users/NovapaX","html_url":"https://github.com/NovapaX","followers_url":"https://api.github.com/users/NovapaX/followers","following_url":"https://api.github.com/users/NovapaX/following{/other_user}","gists_url":"https://api.github.com/users/NovapaX/gists{/gist_id}","starred_url":"https://api.github.com/users/NovapaX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NovapaX/subscriptions","organizations_url":"https://api.github.com/users/NovapaX/orgs","repos_url":"https://api.github.com/users/NovapaX/repos","events_url":"https://api.github.com/users/NovapaX/events{/privacy}","received_events_url":"https://api.github.com/users/NovapaX/received_events","type":"User","site_admin":false},"labels":[{"id":528252411,"url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/labels/cla-signed","name":"cla-signed","color":"008000","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-04-06T21:30:25Z","updated_at":"2018-04-07T21:48:00Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/pulls/1074","html_url":"https://github.com/home-assistant/home-assistant-polymer/pull/1074","diff_url":"https://github.com/home-assistant/home-assistant-polymer/pull/1074.diff","patch_url":"https://github.com/home-assistant/home-assistant-polymer/pull/1074.patch"},"body":"This will allow setting a 'icon_color' attribute (like the 'icon' attribute we already have)\r\nIt will simple set the value as the css color value.\r\nSo you can do `icon_color: black`, `icon_color: rgba()` or any other valid css.\r\n\r\nSetting an `icon_color` will skip any other color or brightness modification to the icon.\r\n\r\nP.S. this is mainly to help people who use custom UI and are forced to do all kind of wierd hue/saturation calculation to get thier icons colored the right way.\r\nI know the state is not the perfect place for this. But it's neatly coupled with `icon` now so they can move together once there's a better place."},"comment":{"url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/issues/comments/379501580","html_url":"https://github.com/home-assistant/home-assistant-polymer/pull/1074#issuecomment-379501580","issue_url":"https://api.github.com/repos/home-assistant/home-assistant-polymer/issues/1074","id":379501580,"user":{"login":"NovapaX","id":411716,"avatar_url":"https://avatars3.githubusercontent.com/u/411716?v=4","gravatar_id":"","url":"https://api.github.com/users/NovapaX","html_url":"https://github.com/NovapaX","followers_url":"https://api.github.com/users/NovapaX/followers","following_url":"https://api.github.com/users/NovapaX/following{/other_user}","gists_url":"https://api.github.com/users/NovapaX/gists{/gist_id}","starred_url":"https://api.github.com/users/NovapaX/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NovapaX/subscriptions","organizations_url":"https://api.github.com/users/NovapaX/orgs","repos_url":"https://api.github.com/users/NovapaX/repos","events_url":"https://api.github.com/users/NovapaX/events{/privacy}","received_events_url":"https://api.github.com/users/NovapaX/received_events","type":"User","site_admin":false},"created_at":"2018-04-07T21:48:00Z","updated_at":"2018-04-07T21:48:00Z","author_association":"CONTRIBUTOR","body":"I can think of a few reasons (some more valid than others)\r\n- Theming: bad reason\r\n- Additional visual identification or differentiation for specific entities\r\n- Visual notifications (e.g. red icon when sensor value above/below certain threshold, so colorizing based on state, like we do with lights)\r\n\r\nThat first case should be covered by theming. When we have a new frontend-config stuff going we could allow to set theming variables for specific parts of the interface (so all icons in a card could have a different active-color.\r\n\r\nSecond case should be in frontend configuration for that specific entity.\r\n\r\nLast case seems kind of valid. Most of the times this is done with the custom_ui component that allows templated attributes. https://github.com/andrey-git/home-assistant-custom-ui/blob/master/docs/features.md#template-attributes \r\nWe could add attributes like 'warning_level' and hardcoded colors or adding even more variables. But then we'd have covered a single use case (warning thresholds). What if I want to color a rest-sensor with trash-can icon green/black/blue based on the type of garbage I need to put on the side of the road today)\r\nInstead we could just simply allow setting an icon_ color by name (or any other valid css color) and cover a lot of the possible use-cases."}}
{"actor":{"display_login":"NovapaX"}}