mirror of
https://github.com/home-assistant/frontend.git
synced 2025-11-11 03:51:07 +00:00
Adjust the binary_sensor icon according to sensor_class
This makes us call stateIcon() from computeIcon() instead of domainIcon(), and breaks out the actual icon determination logic into a separate function. I tested with a sensor in a card and a badge and it looks good.
This commit is contained in:
@@ -2,6 +2,7 @@ import Polymer from '../../polymer';
|
||||
import hass from '../../util/home-assistant-js-instance';
|
||||
import domainIcon from '../../util/domain-icon';
|
||||
import canToggle from '../../util/can-toggle';
|
||||
import stateIcon from '../../util/state-icon';
|
||||
|
||||
require('../../components/ha-label-badge');
|
||||
|
||||
@@ -84,7 +85,7 @@ export default new Polymer({
|
||||
case 'scene':
|
||||
case 'updater':
|
||||
case 'script':
|
||||
return domainIcon(state.domain, state.state);
|
||||
return stateIcon(state);
|
||||
case 'sun':
|
||||
return state.state === 'above_horizon' ?
|
||||
domainIcon(state.domain) : 'mdi:brightness-3';
|
||||
|
||||
Reference in New Issue
Block a user