Add support for garage doors

This commit is contained in:
Paulus Schoutsen 2016-02-11 21:51:25 -08:00
parent 31fb734c5b
commit 0d59490ebc
2 changed files with 8 additions and 1 deletions

View File

@ -53,7 +53,8 @@ export default new Polymer({
}, },
_checkToggle(stateObj) { _checkToggle(stateObj) {
return stateObj && stateObj.state !== 'off' && stateObj.state !== 'unlocked'; return stateObj && stateObj.state !== 'off' &&
stateObj.state !== 'unlocked' && stateObj.state !== 'closed';
}, },
// We call updateToggle after a successful call to re-sync the toggle // We call updateToggle after a successful call to re-sync the toggle
@ -67,6 +68,9 @@ export default new Polymer({
if (this.stateObj.domain === 'lock') { if (this.stateObj.domain === 'lock') {
domain = 'lock'; domain = 'lock';
service = turnOn ? 'lock' : 'unlock'; service = turnOn ? 'lock' : 'unlock';
} else if (this.stateObj.domain === 'garage_door') {
domain = 'garage_door';
service = turnOn ? 'open' : 'close';
} else { } else {
domain = 'homeassistant'; domain = 'homeassistant';
service = turnOn ? 'turn_on' : 'turn_off'; service = turnOn ? 'turn_on' : 'turn_off';

View File

@ -23,6 +23,9 @@ export default function domainIcon(domain, state) {
case 'device_tracker': case 'device_tracker':
return 'mdi:account'; return 'mdi:account';
case 'garage_door':
return 'mdi:glassdoor';
case 'group': case 'group':
return 'mdi:google-circles-communities'; return 'mdi:google-circles-communities';