From 0d59490ebcf6be2296a915b06aa918707cc1cd67 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 11 Feb 2016 21:51:25 -0800 Subject: [PATCH] Add support for garage doors --- src/components/entity/ha-entity-toggle.js | 6 +++++- src/util/domain-icon.js | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/entity/ha-entity-toggle.js b/src/components/entity/ha-entity-toggle.js index a091d355e7..03a15084c4 100644 --- a/src/components/entity/ha-entity-toggle.js +++ b/src/components/entity/ha-entity-toggle.js @@ -53,7 +53,8 @@ export default new Polymer({ }, _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 @@ -67,6 +68,9 @@ export default new Polymer({ if (this.stateObj.domain === 'lock') { domain = 'lock'; service = turnOn ? 'lock' : 'unlock'; + } else if (this.stateObj.domain === 'garage_door') { + domain = 'garage_door'; + service = turnOn ? 'open' : 'close'; } else { domain = 'homeassistant'; service = turnOn ? 'turn_on' : 'turn_off'; diff --git a/src/util/domain-icon.js b/src/util/domain-icon.js index 8c18986156..64a85693bc 100644 --- a/src/util/domain-icon.js +++ b/src/util/domain-icon.js @@ -23,6 +23,9 @@ export default function domainIcon(domain, state) { case 'device_tracker': return 'mdi:account'; + case 'garage_door': + return 'mdi:glassdoor'; + case 'group': return 'mdi:google-circles-communities';