Skip to content

Commit

Permalink
Introduced a new device class "plug" for the binary sensor.
Browse files Browse the repository at this point in the history
  • Loading branch information
echox committed Nov 4, 2017
1 parent 6959b18 commit 5889057
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/util/hass-attributes-util.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
binary_sensor: [
'connectivity', 'light', 'moisture', 'motion', 'occupancy', 'opening',
'sound', 'vibration', 'gas', 'power', 'safety', 'smoke', 'cold', 'heat',
'moving'],
'moving', 'plug'],
cover: ['garage'],
};

Expand Down
5 changes: 4 additions & 1 deletion src/util/hass-util.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
window.hassUtil.DOMAINS_WITH_MORE_INFO = [
'alarm_control_panel', 'automation', 'camera', 'climate', 'configurator',
'cover', 'fan', 'group', 'history_graph', 'light', 'lock', 'media_player', 'script',
'sun', 'updater', 'vacuum', 'input_datetime',
'sun', 'updater', 'vacuum', 'input_datetime', 'plug',

This comment has been minimized.

Copy link
@balloob

balloob Nov 4, 2017

This is not a domain…

];

window.hassUtil.DOMAINS_WITH_NO_HISTORY = ['camera', 'configurator', 'history_graph', 'scene'];
Expand Down Expand Up @@ -385,6 +385,8 @@
case 'safety':
case 'smoke':
return activated ? 'mdi:verified' : 'mdi:alert';
case 'plug':
return activated ? 'mdi:power-plug-off' : 'mdi:power-plug';

This comment has been minimized.

Copy link
@balloob

balloob Nov 4, 2017

Why would activated be rendered as off?

default:
return activated ? 'mdi:radiobox-blank' : 'mdi:checkbox-marked-circle';
}
Expand Down Expand Up @@ -497,6 +499,7 @@
case 'light':
case 'moving':
case 'power':
case 'plug':
default:
}
} else if (domain === 'input_datetime') {
Expand Down

0 comments on commit 5889057

Please sign in to comment.