From 478f6eb3b177ff8de7548a400e01b700667a3ff6 Mon Sep 17 00:00:00 2001 From: Eugenio Panadero Date: Sun, 6 Aug 2017 18:29:50 +0200 Subject: [PATCH] Add new service `clean_spot` to vacuums as command in the toolbar (#379) - Add it with the 'broom' icon between the stop and the locate commands. - Fix an error in the supportsCommandBar function --- src/more-infos/more-info-vacuum.html | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/src/more-infos/more-info-vacuum.html b/src/more-infos/more-info-vacuum.html index 06e1172212..0460d6dac9 100644 --- a/src/more-infos/more-info-vacuum.html +++ b/src/more-infos/more-info-vacuum.html @@ -50,6 +50,10 @@ +
+ +
@@ -136,11 +140,16 @@ Polymer({ return (stateObj.attributes.supported_features & 512) !== 0; }, + supportsCleanSpot: function (stateObj) { + return (stateObj.attributes.supported_features & 1024) !== 0; + }, + supportsCommandBar: function (stateObj) { return (((stateObj.attributes.supported_features & 4) !== 0) | ((stateObj.attributes.supported_features & 8) !== 0) - | ((stateObj.attributes.supported_features & 8) !== 0) - | ((stateObj.attributes.supported_features & 512) !== 0)); + | ((stateObj.attributes.supported_features & 16) !== 0) + | ((stateObj.attributes.supported_features & 512) !== 0) + | ((stateObj.attributes.supported_features & 1024) !== 0)); }, /* eslint-enable no-bitwise */ @@ -177,6 +186,12 @@ Polymer({ }); }, + onCleanSpot: function () { + this.hass.callService('vacuum', 'clean_spot', { + entity_id: this.stateObj.entity_id + }); + }, + onReturnHome: function () { this.hass.callService('vacuum', 'return_to_base', { entity_id: this.stateObj.entity_id