From 86dad0c0457ca9155d8ec9150e1d46f58201ade8 Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Wed, 6 Apr 2016 13:51:26 -0700 Subject: [PATCH 001/114] Add ZeroConf support to http.py --- homeassistant/components/http.py | 36 ++++++++++++++++++++++++++++---- requirements_all.txt | 3 +++ 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/http.py b/homeassistant/components/http.py index 00b35dda8c9..18bac7c46fd 100644 --- a/homeassistant/components/http.py +++ b/homeassistant/components/http.py @@ -7,6 +7,7 @@ https://home-assistant.io/developers/api/ import gzip import json import logging +import socket import ssl import threading import time @@ -27,7 +28,9 @@ from homeassistant.const import ( HTTP_HEADER_CONTENT_LENGTH, HTTP_HEADER_CONTENT_TYPE, HTTP_HEADER_EXPIRES, HTTP_HEADER_HA_AUTH, HTTP_HEADER_VARY, HTTP_METHOD_NOT_ALLOWED, HTTP_NOT_FOUND, HTTP_OK, HTTP_UNAUTHORIZED, HTTP_UNPROCESSABLE_ENTITY, - SERVER_PORT) + SERVER_PORT, __version__) + +REQUIREMENTS = ["zeroconf==0.17.5"] DOMAIN = "http" @@ -108,6 +111,10 @@ class HomeAssistantHTTPServer(ThreadingMixIn, HTTPServer): # We will lazy init this one if needed self.event_forwarder = None + from zeroconf import Zeroconf + + self.zeroconf = Zeroconf() + if development: _LOGGER.info("running http in development mode") @@ -122,14 +129,35 @@ class HomeAssistantHTTPServer(ThreadingMixIn, HTTPServer): def stop_http(event): """Stop the HTTP server.""" self.shutdown() + self.zeroconf.unregister_all_services() self.hass.bus.listen_once(ha.EVENT_HOMEASSISTANT_STOP, stop_http) protocol = 'https' if self.use_ssl else 'http' - _LOGGER.info( - "Starting web interface at %s://%s:%d", - protocol, self.server_address[0], self.server_address[1]) + base_url = "{}://{}:{}".format(protocol, util.get_local_ip(), + self.server_address[1]) + + zeroconf_type = "_home-assistant._tcp.local." + zeroconf_name = "{}.{}".format(self.hass.config.location_name, + zeroconf_type) + + ip_address = socket.inet_aton(util.get_local_ip()) + + has_device_tracker = ("device_tracker" in self.hass.config.components) + + params = {"version": __version__, "base_url": base_url, + "device_tracker_component": has_device_tracker, + "needs_password": (self.api_password != "")} + + from zeroconf import ServiceInfo + + info = ServiceInfo(zeroconf_type, zeroconf_name, ip_address, + self.server_address[1], 0, 0, params) + + self.zeroconf.register_service(info) + + _LOGGER.info("Starting web interface at %s", base_url) # 31-1-2015: Refactored frontend/api components out of this component # To prevent stuff from breaking, load the two extracted components diff --git a/requirements_all.txt b/requirements_all.txt index c0b011e869d..56829f67f97 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -313,3 +313,6 @@ xbee-helper==0.0.6 # homeassistant.components.sensor.yr xmltodict + +# homeassistant.components.http +zeroconf==0.17.5 From 27aabd961cca59828efbfdba0fc49ff65ccf79d8 Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Wed, 6 Apr 2016 13:51:43 -0700 Subject: [PATCH 002/114] Remove unnecessary variable --- homeassistant/components/http.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/http.py b/homeassistant/components/http.py index 18bac7c46fd..99f745adcb2 100644 --- a/homeassistant/components/http.py +++ b/homeassistant/components/http.py @@ -142,8 +142,6 @@ class HomeAssistantHTTPServer(ThreadingMixIn, HTTPServer): zeroconf_name = "{}.{}".format(self.hass.config.location_name, zeroconf_type) - ip_address = socket.inet_aton(util.get_local_ip()) - has_device_tracker = ("device_tracker" in self.hass.config.components) params = {"version": __version__, "base_url": base_url, @@ -152,7 +150,8 @@ class HomeAssistantHTTPServer(ThreadingMixIn, HTTPServer): from zeroconf import ServiceInfo - info = ServiceInfo(zeroconf_type, zeroconf_name, ip_address, + info = ServiceInfo(zeroconf_type, zeroconf_name, + socket.inet_aton(util.get_local_ip()), self.server_address[1], 0, 0, params) self.zeroconf.register_service(info) From ff47cffe8a5c2017a6e422d74d8831365159fee7 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Fri, 8 Apr 2016 21:43:29 -0700 Subject: [PATCH 003/114] Version bump to 0.18.0.dev0 --- homeassistant/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/const.py b/homeassistant/const.py index 2356a90ba91..6837bf582e8 100644 --- a/homeassistant/const.py +++ b/homeassistant/const.py @@ -1,7 +1,7 @@ # coding: utf-8 """Constants used by Home Assistant components.""" -__version__ = "0.17.0" +__version__ = "0.18.0.dev0" REQUIRED_PYTHON_VER = (3, 4) PLATFORM_FORMAT = '{}.{}' From f36cfcdbd97f55d0a8f6cde2416cb7f9fe574cb3 Mon Sep 17 00:00:00 2001 From: John Arild Berentsen Date: Sat, 9 Apr 2016 10:50:46 +0200 Subject: [PATCH 004/114] We need to allow extra keys on top level componenet config fixes #1756 --- homeassistant/components/rfxtrx.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/rfxtrx.py b/homeassistant/components/rfxtrx.py index c0e88785685..610350a7e63 100644 --- a/homeassistant/components/rfxtrx.py +++ b/homeassistant/components/rfxtrx.py @@ -65,7 +65,7 @@ CONFIG_SCHEMA = vol.Schema({ vol.Optional(ATTR_DEBUG, default=False): cv.boolean, vol.Optional(ATTR_DUMMY, default=False): cv.boolean, }), -}) +}, extra=vol.ALLOW_EXTRA) def setup(hass, config): From c210242c80a844956f705870302682886fb47964 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Sat, 9 Apr 2016 10:55:42 +0200 Subject: [PATCH 005/114] Add comment about location of hass (fixes #1723) --- script/home-assistant@.service | 3 +++ 1 file changed, 3 insertions(+) diff --git a/script/home-assistant@.service b/script/home-assistant@.service index 9c4876f9789..a36a6e743b1 100644 --- a/script/home-assistant@.service +++ b/script/home-assistant@.service @@ -1,5 +1,7 @@ # This is a simple service file for systems with systemd to tun HA as user. # +# For details please check https://home-assistant.io/getting-started/autostart/ +# [Unit] Description=Home Assistant for %i After=network.target @@ -9,6 +11,7 @@ Type=simple User=%i # Enable the following line if you get network-related HA errors during boot #ExecStartPre=/usr/bin/sleep 60 +# Use `whereis hass` to determine the path of hass ExecStart=/usr/bin/hass SendSIGKILL=no From 3aa4727b189305d845b216024a14780ab9ce6295 Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Sat, 9 Apr 2016 12:03:41 -0400 Subject: [PATCH 006/114] Fix for MQTT config validation on the protocol field. (#1765) --- homeassistant/components/mqtt/__init__.py | 2 +- tests/components/mqtt/test_init.py | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/mqtt/__init__.py b/homeassistant/components/mqtt/__init__.py index ae932f26ff6..510aedb00e2 100644 --- a/homeassistant/components/mqtt/__init__.py +++ b/homeassistant/components/mqtt/__init__.py @@ -90,7 +90,7 @@ CONFIG_SCHEMA = vol.Schema({ vol.Optional(CONF_PASSWORD): cv.string, vol.Optional(CONF_CERTIFICATE): cv.isfile, vol.Optional(CONF_PROTOCOL, default=DEFAULT_PROTOCOL): - [PROTOCOL_31, PROTOCOL_311], + vol.All(cv.string, vol.In([PROTOCOL_31, PROTOCOL_311])), vol.Optional(CONF_EMBEDDED): _HBMQTT_CONFIG_SCHEMA, }), }, extra=vol.ALLOW_EXTRA) diff --git a/tests/components/mqtt/test_init.py b/tests/components/mqtt/test_init.py index c83f8380913..4c5f14bf0f1 100644 --- a/tests/components/mqtt/test_init.py +++ b/tests/components/mqtt/test_init.py @@ -58,6 +58,17 @@ class TestMQTT(unittest.TestCase): } }) + def test_setup_protocol_validation(self): + """Test for setup failure if connection to broker is missing.""" + with mock.patch('paho.mqtt.client.Client'): + self.hass.config.components = [] + assert _setup_component(self.hass, mqtt.DOMAIN, { + mqtt.DOMAIN: { + mqtt.CONF_BROKER: 'test-broker', + mqtt.CONF_PROTOCOL: 3.1, + } + }) + def test_publish_calls_service(self): """Test the publishing of call to services.""" self.hass.bus.listen_once(EVENT_CALL_SERVICE, self.record_calls) From 7a25ae3e2c011e531820b7aef2dfebf10e235bb5 Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Sat, 9 Apr 2016 12:07:13 -0400 Subject: [PATCH 007/114] Fix for light service validation. (#1770) Incorrect validation tested if passed value was a list instead of a member of the list. --- homeassistant/components/light/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/light/__init__.py b/homeassistant/components/light/__init__.py index c8b108003b7..f78e1dbdcba 100644 --- a/homeassistant/components/light/__init__.py +++ b/homeassistant/components/light/__init__.py @@ -92,8 +92,8 @@ LIGHT_TURN_ON_SCHEMA = vol.Schema({ ATTR_XY_COLOR: vol.All(vol.ExactSequence((cv.small_float, cv.small_float)), vol.Coerce(tuple)), ATTR_COLOR_TEMP: vol.All(int, vol.Range(min=154, max=500)), - ATTR_FLASH: [FLASH_SHORT, FLASH_LONG], - ATTR_EFFECT: [EFFECT_COLORLOOP, EFFECT_RANDOM, EFFECT_WHITE], + ATTR_FLASH: vol.In([FLASH_SHORT, FLASH_LONG]), + ATTR_EFFECT: vol.In([EFFECT_COLORLOOP, EFFECT_RANDOM, EFFECT_WHITE]), }) LIGHT_TURN_OFF_SCHEMA = vol.Schema({ From 982f8f41aebe10fcbdbff77621ace55106a8a371 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sat, 9 Apr 2016 09:09:17 -0700 Subject: [PATCH 008/114] Update frontend with weblink fix --- homeassistant/components/frontend/version.py | 2 +- homeassistant/components/frontend/www_static/frontend.html | 2 +- .../components/frontend/www_static/home-assistant-polymer | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/frontend/version.py b/homeassistant/components/frontend/version.py index 5f27f606cb8..93ae4032b56 100644 --- a/homeassistant/components/frontend/version.py +++ b/homeassistant/components/frontend/version.py @@ -1,2 +1,2 @@ """DO NOT MODIFY. Auto-generated by build_frontend script.""" -VERSION = "4062ab87999fd5e382074ba9d7a880d7" +VERSION = "c2932592a6946e955ddc46f31409b81f" diff --git a/homeassistant/components/frontend/www_static/frontend.html b/homeassistant/components/frontend/www_static/frontend.html index 8a6c2285480..799ecae4a09 100644 --- a/homeassistant/components/frontend/www_static/frontend.html +++ b/homeassistant/components/frontend/www_static/frontend.html @@ -3658,7 +3658,7 @@ e.bindAnimationForKeyframeEffect(this)),(this.effect instanceof window.SequenceE text-transform: capitalize; line-height: 40px; margin-left: 16px; - } \ No newline at end of file + } \ No newline at end of file diff --git a/homeassistant/components/frontend/www_static/home-assistant-polymer b/homeassistant/components/frontend/www_static/home-assistant-polymer index ac311416a99..a127c74a539 160000 --- a/homeassistant/components/frontend/www_static/home-assistant-polymer +++ b/homeassistant/components/frontend/www_static/home-assistant-polymer @@ -1 +1 @@ -Subproject commit ac311416a99f41abbe98142ccac5f84f77d88296 +Subproject commit a127c74a53955149cbd07d8f2e67a7e230513405 diff --git a/homeassistant/components/media_player/demo.py b/homeassistant/components/media_player/demo.py index 559c9d39bf3..e4015cd5b71 100644 --- a/homeassistant/components/media_player/demo.py +++ b/homeassistant/components/media_player/demo.py @@ -24,7 +24,7 @@ def setup_platform(hass, config, add_devices, discovery_info=None): ]) -YOUTUBE_COVER_URL_FORMAT = 'https://img.youtube.com/vi/{}/1.jpg' +YOUTUBE_COVER_URL_FORMAT = 'https://img.youtube.com/vi/{}/hqdefault.jpg' YOUTUBE_PLAYER_SUPPORT = \ SUPPORT_PAUSE | SUPPORT_VOLUME_SET | SUPPORT_VOLUME_MUTE | \ @@ -208,7 +208,8 @@ class DemoMusicPlayer(AbstractDemoPlayer): @property def media_image_url(self): """Return the image url of current playing media.""" - return 'https://graph.facebook.com/107771475912710/picture' + return 'https://graph.facebook.com/v2.5/107771475912710/' \ + 'picture?type=large' @property def media_title(self): @@ -287,7 +288,7 @@ class DemoTVShowPlayer(AbstractDemoPlayer): @property def media_image_url(self): """Return the image url of current playing media.""" - return 'https://graph.facebook.com/HouseofCards/picture' + return 'https://graph.facebook.com/v2.5/HouseofCards/picture?width=400' @property def media_title(self): From 3d98b8b5b317807d46fad6abd8867aac3482e527 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 10 Apr 2016 01:43:40 -0700 Subject: [PATCH 016/114] Update frontend --- homeassistant/components/frontend/version.py | 2 +- homeassistant/components/frontend/www_static/frontend.html | 2 +- .../components/frontend/www_static/home-assistant-polymer | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/frontend/version.py b/homeassistant/components/frontend/version.py index 351b07f7fc7..1d137f6f83a 100644 --- a/homeassistant/components/frontend/version.py +++ b/homeassistant/components/frontend/version.py @@ -1,2 +1,2 @@ """DO NOT MODIFY. Auto-generated by build_frontend script.""" -VERSION = "6dec5973573b17427025b90ee846730b" +VERSION = "50a185fc83edd53abb848ba9e6f8931e" diff --git a/homeassistant/components/frontend/www_static/frontend.html b/homeassistant/components/frontend/www_static/frontend.html index 7c6e82f19aa..bef20c0fcac 100644 --- a/homeassistant/components/frontend/www_static/frontend.html +++ b/homeassistant/components/frontend/www_static/frontend.html @@ -6585,6 +6585,6 @@ value:function(t,e){if(0===this.__batchDepth){if(h.getOption(this.reactorState," pane:e})}Object.defineProperty(e,"__esModule",{value:!0}),e.showSidebar=i,e.navigate=o;var a=n(21),u=r(a)},function(t,e){"use strict";function n(t){return[r,function(e){return e===t}]}Object.defineProperty(e,"__esModule",{value:!0}),e.isActivePane=n;var r=e.activePane=["selectedNavigationPanel"];e.showSidebar=["showSidebar"]},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}function o(t){t.registerStores({selectedNavigationPanel:u["default"],showSidebar:c["default"]})}Object.defineProperty(e,"__esModule",{value:!0}),e.urlSync=e.getters=e.actions=void 0,e.register=o;var a=n(105),u=i(a),s=n(106),c=i(s),l=n(43),f=r(l),d=n(44),h=r(d),p=n(107),_=r(p);e.actions=f,e.getters=h,e.urlSync=_},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(6),o=r(i);e["default"]=(0,o["default"])({NOTIFICATION_CREATED:null})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){return[h(t),function(t){return!!t&&t.services.has(e)}]}function o(t){return[u.getters.byId(t),d,f["default"]]}Object.defineProperty(e,"__esModule",{value:!0}),e.byDomain=e.entityMap=e.hasData=void 0,e.hasService=i,e.canToggleEntity=o;var a=n(10),u=n(8),s=n(48),c=r(s),l=n(117),f=r(l),d=(e.hasData=(0,a.createHasDataGetter)(c["default"]),e.entityMap=(0,a.createEntityMapGetter)(c["default"])),h=e.byDomain=(0,a.createByIdGetter)(c["default"])},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n6e4}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(35),u=r(a);e["default"]=new o["default"]({is:"domain-icon",properties:{domain:{type:String,value:""},state:{type:String,value:""}},computeIcon:function(t,e){return(0,u["default"])(t,e)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);e["default"]=new o["default"]({is:"ha-card",properties:{header:{type:String},elevation:{type:Number,value:1,reflectToAttribute:!0}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(67),o=r(i),a=n(2),u=r(a),s=n(1),c=r(s),l=6e4,f=u["default"].util.parseDateTime;e["default"]=new c["default"]({is:"relative-ha-datetime",properties:{datetime:{type:String,observer:"datetimeChanged"},datetimeObj:{type:Object,observer:"datetimeObjChanged"},parsedDateTime:{type:Object},relativeTime:{type:String,value:"not set"}},created:function(){this.updateRelative=this.updateRelative.bind(this)},attached:function(){this._interval=setInterval(this.updateRelative,l)},detached:function(){clearInterval(this._interval)},datetimeChanged:function(t){this.parsedDateTime=t?f(t):null,this.updateRelative()},datetimeObjChanged:function(t){this.parsedDateTime=t,this.updateRelative()},updateRelative:function(){this.relativeTime=this.parsedDateTime?(0,o["default"])(this.parsedDateTime).fromNow():""}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(31),n(162),n(161),e["default"]=new o["default"]({is:"state-history-charts",properties:{stateHistory:{type:Object},isLoadingData:{type:Boolean,value:!1},apiLoaded:{type:Boolean,value:!1},isLoading:{type:Boolean,computed:"computeIsLoading(isLoadingData, apiLoaded)"},groupedStateHistory:{type:Object,computed:"computeGroupedStateHistory(isLoading, stateHistory)"},isSingleDevice:{type:Boolean,computed:"computeIsSingleDevice(stateHistory)"}},computeIsSingleDevice:function(t){return t&&1===t.size},computeGroupedStateHistory:function(t,e){if(t||!e)return{line:[],timeline:[]};var n={},r=[];e.forEach(function(t){if(t&&0!==t.size){var e=t.find(function(t){return"unit_of_measurement"in t.attributes}),i=e?e.attributes.unit_of_measurement:!1;i?i in n?n[i].push(t.toArray()):n[i]=[t.toArray()]:r.push(t.toArray())}}),r=r.length>0&&r;var i=Object.keys(n).map(function(t){return[t,n[t]]});return{line:i,timeline:r}},googleApiLoaded:function(){var t=this;window.google.load("visualization","1",{packages:["timeline","corechart"],callback:function(){t.apiLoaded=!0}})},computeContentClasses:function(t){return t?"loading":""},computeIsLoading:function(t,e){return t||!e},computeIsEmpty:function(t){return t&&0===t.size},extractUnit:function(t){return t[0]},extractData:function(t){return t[1]}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(7),e["default"]=new o["default"]({is:"state-card-display",properties:{detailed:{type:Boolean,value:!1},stateObj:{type:Object}}})},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]="mdi:bookmark"},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){return(0,a["default"])(t).format("LT")}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var o=n(67),a=r(o)},function(t,e){"use strict";function n(){var t=document.getElementById("ha-init-skeleton");t&&t.parentElement.removeChild(t)}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){var e=t.state&&"off"===t.state;switch(t.attributes.sensor_class){case"opening":return e?"mdi:crop-square":"mdi:exit-to-app";case"moisture":return e?"mdi:water-off":"mdi:water";case"light":return e?"mdi:brightness-5":"mdi:brightness-7";case"sound":return e?"mdi:music-note-off":"mdi:music-note";case"vibration":return e?"mdi:crop-portrait":"mdi:vibrate";case"connectivity":return e?"mdi:server-network-off":"mdi:server-network";case"safety":case"gas":case"smoke":case"power":return e?"mdi:verified":"mdi:alert";case"motion":return e?"mdi:walk":"mdi:run";case"digital":default:return e?"mdi:radiobox-blank":"mdi:checkbox-marked-circle"}}function o(t){if(!t)return u["default"];if(t.attributes.icon)return t.attributes.icon;var e=t.attributes.unit_of_measurement;if(e&&"sensor"===t.domain){if(e===d.UNIT_TEMP_C||e===d.UNIT_TEMP_F)return"mdi:thermometer";if("Mice"===e)return"mdi:mouse-variant"}else if("binary_sensor"===t.domain)return i(t);return(0,c["default"])(t.domain,t.state)}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=o;var a=n(60),u=r(a),s=n(35),c=r(s),l=n(2),f=r(l),d=f["default"].util.temperatureUnits},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=function(t,e){a.validate(t,{rememberAuth:e,useStreaming:u.useStreaming})};var i=n(2),o=r(i),a=o["default"].authActions,u=o["default"].localStoragePreferences},function(t,e,n){function r(t,e,n){function r(e){var n=m,r=g;return m=g=void 0,O=e,b=t.apply(r,n)}function l(t){return O=t,S=setTimeout(h,e),M?r(t):b}function f(t){var n=t-w,r=t-O,i=e-n;return I===!1?i:c(i,I-r)}function d(t){var n=t-w,r=t-O;return!w||n>=e||0>n||I!==!1&&r>=I}function h(){var t=o();return d(t)?p(t):void(S=setTimeout(h,f(t)))}function p(t){return clearTimeout(S),S=void 0,T&&m?r(t):(m=g=void 0,b)}function _(){void 0!==S&&clearTimeout(S),w=O=0,m=g=S=void 0}function v(){return void 0===S?b:p(o())}function y(){var t=o(),n=d(t);return m=arguments,g=this,w=t,n?void 0===S?l(w):(clearTimeout(S),S=setTimeout(h,e),r(w)):b}var m,g,b,S,w=0,O=0,M=!1,I=!1,T=!0;if("function"!=typeof t)throw new TypeError(u);return e=a(e)||0,i(n)&&(M=!!n.leading,I="maxWait"in n&&s(a(n.maxWait)||0,e),T="trailing"in n?!!n.trailing:T),y.cancel=_,y.flush=v,y}var i=n(17),o=n(218),a=n(66),u="Expected a function",s=Math.max,c=Math.min;t.exports=r},function(t,e,n){function r(t){if("number"==typeof t)return t;if(a(t))return u;if(o(t)){var e=i(t.valueOf)?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(s,"");var n=l.test(t);return n||f.test(t)?d(t.slice(2),n?2:8):c.test(t)?u:+t}var i=n(37),o=n(17),a=n(217),u=NaN,s=/^\s+|\s+$/g,c=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,f=/^0o[0-7]+$/i,d=parseInt;t.exports=r},function(t,e,n){(function(t){!function(e,n){t.exports=n()}(this,function(){"use strict";function e(){return Qn.apply(null,arguments)}function n(t){Qn=t}function r(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function i(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function o(t,e){var n,r=[];for(n=0;n0)for(n in tr)r=tr[n],i=e[r],h(i)||(t[r]=i);return t}function _(t){p(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),er===!1&&(er=!0,e.updateOffset(this),er=!1)}function v(t){return t instanceof _||null!=t&&null!=t._isAMomentObject}function y(t){return 0>t?Math.ceil(t):Math.floor(t)}function m(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=y(e)),n}function g(t,e,n){var r,i=Math.min(t.length,e.length),o=Math.abs(t.length-e.length),a=0;for(r=0;i>r;r++)(n&&t[r]!==e[r]||!n&&m(t[r])!==m(e[r]))&&a++;return a+o}function b(t){e.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function S(t,e){var n=!0;return u(function(){return n&&(b(t+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),n=!1),e.apply(this,arguments)},e)}function w(t,e){nr[t]||(b(e),nr[t]=!0)}function O(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function M(t){return"[object Object]"===Object.prototype.toString.call(t)}function I(t){var e,n;for(n in t)e=t[n],O(e)?this[n]=e:this["_"+n]=e;this._config=t,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function T(t,e){var n,r=u({},t);for(n in e)a(e,n)&&(M(t[n])&&M(e[n])?(r[n]={},u(r[n],t[n]),u(r[n],e[n])):null!=e[n]?r[n]=e[n]:delete r[n]);return r}function E(t){null!=t&&this.set(t)}function D(t){return t?t.toLowerCase().replace("_","-"):t}function j(t){for(var e,n,r,i,o=0;o0;){if(r=C(i.slice(0,e).join("-")))return r;if(n&&n.length>=e&&g(i,n,!0)>=e-1)break;e--}o++}return null}function C(e){var n=null;if(!ir[e]&&"undefined"!=typeof t&&t&&t.exports)try{n=rr._abbr,!function(){var t=new Error('Cannot find module "./locale"');throw t.code="MODULE_NOT_FOUND",t}(),P(n)}catch(r){}return ir[e]}function P(t,e){var n;return t&&(n=h(e)?L(t):A(t,e),n&&(rr=n)),rr._abbr}function A(t,e){return null!==e?(e.abbr=t,null!=ir[t]?(w("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),e=T(ir[t]._config,e)):null!=e.parentLocale&&(null!=ir[e.parentLocale]?e=T(ir[e.parentLocale]._config,e):w("parentLocaleUndefined","specified parentLocale is not defined yet")),ir[t]=new E(e),P(t),ir[t]):(delete ir[t],null)}function k(t,e){if(null!=e){var n;null!=ir[t]&&(e=T(ir[t]._config,e)),n=new E(e),n.parentLocale=ir[t],ir[t]=n,P(t)}else null!=ir[t]&&(null!=ir[t].parentLocale?ir[t]=ir[t].parentLocale:null!=ir[t]&&delete ir[t]);return ir[t]}function L(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return rr;if(!r(t)){if(e=C(t))return e;t=[t]}return j(t)}function N(){return Object.keys(ir)}function x(t,e){var n=t.toLowerCase();or[n]=or[n+"s"]=or[e]=t}function R(t){return"string"==typeof t?or[t]||or[t.toLowerCase()]:void 0}function H(t){var e,n,r={};for(n in t)a(t,n)&&(e=R(n),e&&(r[e]=t[n]));return r}function Y(t,n){return function(r){return null!=r?(U(this,t,r),e.updateOffset(this,n),this):z(this,t)}}function z(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function U(t,e,n){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](n)}function V(t,e){var n;if("object"==typeof t)for(n in t)this.set(n,t[n]);else if(t=R(t),O(this[t]))return this[t](e);return this}function B(t,e,n){var r=""+Math.abs(t),i=e-r.length,o=t>=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}function G(t,e,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),t&&(cr[t]=i),e&&(cr[e[0]]=function(){return B(i.apply(this,arguments),e[1],e[2])}),n&&(cr[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function F(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function W(t){var e,n,r=t.match(ar);for(e=0,n=r.length;n>e;e++)cr[r[e]]?r[e]=cr[r[e]]:r[e]=F(r[e]);return function(i){var o="";for(e=0;n>e;e++)o+=r[e]instanceof Function?r[e].call(i,t):r[e];return o}}function q(t,e){return t.isValid()?(e=K(e,t.localeData()),sr[e]=sr[e]||W(e),sr[e](t)):t.localeData().invalidDate()}function K(t,e){function n(t){return e.longDateFormat(t)||t}var r=5;for(ur.lastIndex=0;r>=0&&ur.test(t);)t=t.replace(ur,n),ur.lastIndex=0,r-=1;return t}function J(t,e,n){Er[t]=O(e)?e:function(t,r){return t&&n?n:e}}function $(t,e){return a(Er,t)?Er[t](e._strict,e._locale):new RegExp(Z(t))}function Z(t){return X(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,r,i){return e||n||r||i}))}function X(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Q(t,e){var n,r=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(r=function(t,n){n[e]=m(t)}),n=0;nr;r++){if(i=s([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(o="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(o.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[r].test(t))return r;if(n&&"MMM"===e&&this._shortMonthsParse[r].test(t))return r;if(!n&&this._monthsParse[r].test(t))return r}}function at(t,e){var n;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=m(e);else if(e=t.localeData().monthsParse(e),"number"!=typeof e)return t;return n=Math.min(t.date(),nt(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t}function ut(t){return null!=t?(at(this,t),e.updateOffset(this,!0),this):z(this,"Month")}function st(){return nt(this.year(),this.month())}function ct(t){return this._monthsParseExact?(a(this,"_monthsRegex")||ft.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex}function lt(t){return this._monthsParseExact?(a(this,"_monthsRegex")||ft.call(this),t?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex}function ft(){function t(t,e){return e.length-t.length}var e,n,r=[],i=[],o=[];for(e=0;12>e;e++)n=s([2e3,e]),r.push(this.monthsShort(n,"")),i.push(this.months(n,"")),o.push(this.months(n,"")),o.push(this.monthsShort(n,""));for(r.sort(t),i.sort(t),o.sort(t),e=0;12>e;e++)r[e]=X(r[e]),i[e]=X(i[e]),o[e]=X(o[e]);this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")$","i")}function dt(t){var e,n=t._a;return n&&-2===l(t).overflow&&(e=n[Cr]<0||n[Cr]>11?Cr:n[Pr]<1||n[Pr]>nt(n[jr],n[Cr])?Pr:n[Ar]<0||n[Ar]>24||24===n[Ar]&&(0!==n[kr]||0!==n[Lr]||0!==n[Nr])?Ar:n[kr]<0||n[kr]>59?kr:n[Lr]<0||n[Lr]>59?Lr:n[Nr]<0||n[Nr]>999?Nr:-1,l(t)._overflowDayOfYear&&(jr>e||e>Pr)&&(e=Pr),l(t)._overflowWeeks&&-1===e&&(e=xr),l(t)._overflowWeekday&&-1===e&&(e=Rr),l(t).overflow=e),t}function ht(t){var e,n,r,i,o,a,u=t._i,s=Br.exec(u)||Gr.exec(u);if(s){for(l(t).iso=!0,e=0,n=Wr.length;n>e;e++)if(Wr[e][1].exec(s[1])){i=Wr[e][0],r=Wr[e][2]!==!1;break}if(null==i)return void(t._isValid=!1);if(s[3]){for(e=0,n=qr.length;n>e;e++)if(qr[e][1].exec(s[3])){o=(s[2]||" ")+qr[e][0];break}if(null==o)return void(t._isValid=!1)}if(!r&&null!=o)return void(t._isValid=!1);if(s[4]){if(!Fr.exec(s[4]))return void(t._isValid=!1);a="Z"}t._f=i+(o||"")+(a||""),Dt(t)}else t._isValid=!1}function pt(t){var n=Kr.exec(t._i);return null!==n?void(t._d=new Date(+n[1])):(ht(t),void(t._isValid===!1&&(delete t._isValid,e.createFromInputFallback(t))))}function _t(t,e,n,r,i,o,a){var u=new Date(t,e,n,r,i,o,a);return 100>t&&t>=0&&isFinite(u.getFullYear())&&u.setFullYear(t),u}function vt(t){var e=new Date(Date.UTC.apply(null,arguments));return 100>t&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function yt(t){return mt(t)?366:365}function mt(t){return t%4===0&&t%100!==0||t%400===0}function gt(){return mt(this.year())}function bt(t,e,n){var r=7+e-n,i=(7+vt(t,0,r).getUTCDay()-e)%7;return-i+r-1}function St(t,e,n,r,i){var o,a,u=(7+n-r)%7,s=bt(t,r,i),c=1+7*(e-1)+u+s;return 0>=c?(o=t-1,a=yt(o)+c):c>yt(t)?(o=t+1,a=c-yt(t)):(o=t,a=c),{year:o,dayOfYear:a}}function wt(t,e,n){var r,i,o=bt(t.year(),e,n),a=Math.floor((t.dayOfYear()-o-1)/7)+1;return 1>a?(i=t.year()-1,r=a+Ot(i,e,n)):a>Ot(t.year(),e,n)?(r=a-Ot(t.year(),e,n),i=t.year()+1):(i=t.year(),r=a),{week:r,year:i}}function Ot(t,e,n){var r=bt(t,e,n),i=bt(t+1,e,n);return(yt(t)-r+i)/7}function Mt(t,e,n){return null!=t?t:null!=e?e:n}function It(t){var n=new Date(e.now());return t._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function Tt(t){var e,n,r,i,o=[];if(!t._d){for(r=It(t),t._w&&null==t._a[Pr]&&null==t._a[Cr]&&Et(t),t._dayOfYear&&(i=Mt(t._a[jr],r[jr]),t._dayOfYear>yt(i)&&(l(t)._overflowDayOfYear=!0),n=vt(i,0,t._dayOfYear),t._a[Cr]=n.getUTCMonth(),t._a[Pr]=n.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=o[e]=r[e];for(;7>e;e++)t._a[e]=o[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[Ar]&&0===t._a[kr]&&0===t._a[Lr]&&0===t._a[Nr]&&(t._nextDay=!0,t._a[Ar]=0),t._d=(t._useUTC?vt:_t).apply(null,o),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Ar]=24)}}function Et(t){var e,n,r,i,o,a,u,s;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(o=1,a=4,n=Mt(e.GG,t._a[jr],wt(xt(),1,4).year),r=Mt(e.W,1),i=Mt(e.E,1),(1>i||i>7)&&(s=!0)):(o=t._locale._week.dow,a=t._locale._week.doy,n=Mt(e.gg,t._a[jr],wt(xt(),o,a).year),r=Mt(e.w,1),null!=e.d?(i=e.d,(0>i||i>6)&&(s=!0)):null!=e.e?(i=e.e+o,(e.e<0||e.e>6)&&(s=!0)):i=o),1>r||r>Ot(n,o,a)?l(t)._overflowWeeks=!0:null!=s?l(t)._overflowWeekday=!0:(u=St(n,r,i,o,a),t._a[jr]=u.year,t._dayOfYear=u.dayOfYear)}function Dt(t){if(t._f===e.ISO_8601)return void ht(t);t._a=[],l(t).empty=!0;var n,r,i,o,a,u=""+t._i,s=u.length,c=0;for(i=K(t._f,t._locale).match(ar)||[],n=0;n0&&l(t).unusedInput.push(a),u=u.slice(u.indexOf(r)+r.length),c+=r.length),cr[o]?(r?l(t).empty=!1:l(t).unusedTokens.push(o),et(o,r,t)):t._strict&&!r&&l(t).unusedTokens.push(o);l(t).charsLeftOver=s-c,u.length>0&&l(t).unusedInput.push(u),l(t).bigHour===!0&&t._a[Ar]<=12&&t._a[Ar]>0&&(l(t).bigHour=void 0),t._a[Ar]=jt(t._locale,t._a[Ar],t._meridiem),Tt(t),dt(t)}function jt(t,e,n){var r;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?(r=t.isPM(n),r&&12>e&&(e+=12),r||12!==e||(e=0),e):e}function Ct(t){var e,n,r,i,o;if(0===t._f.length)return l(t).invalidFormat=!0,void(t._d=new Date(NaN));for(i=0;io)&&(r=o,n=e));u(t,n||e)}function Pt(t){if(!t._d){var e=H(t._i);t._a=o([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],function(t){return t&&parseInt(t,10)}),Tt(t)}}function At(t){var e=new _(dt(kt(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function kt(t){var e=t._i,n=t._f;return t._locale=t._locale||L(t._l),null===e||void 0===n&&""===e?d({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),v(e)?new _(dt(e)):(r(n)?Ct(t):n?Dt(t):i(e)?t._d=e:Lt(t),f(t)||(t._d=null),t))}function Lt(t){var n=t._i;void 0===n?t._d=new Date(e.now()):i(n)?t._d=new Date(+n):"string"==typeof n?pt(t):r(n)?(t._a=o(n.slice(0),function(t){return parseInt(t,10)}),Tt(t)):"object"==typeof n?Pt(t):"number"==typeof n?t._d=new Date(n):e.createFromInputFallback(t)}function Nt(t,e,n,r,i){var o={};return"boolean"==typeof n&&(r=n,n=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=i,o._l=n,o._i=t,o._f=e,o._strict=r,At(o)}function xt(t,e,n,r){return Nt(t,e,n,r,!1)}function Rt(t,e){var n,i;if(1===e.length&&r(e[0])&&(e=e[0]),!e.length)return xt();for(n=e[0],i=1;it&&(t=-t,n="-"),n+B(~~(t/60),2)+e+B(~~t%60,2)})}function Bt(t,e){var n=(e||"").match(t)||[],r=n[n.length-1]||[],i=(r+"").match(Qr)||["-",0,0],o=+(60*i[1])+m(i[2]);return"+"===i[0]?o:-o}function Gt(t,n){var r,o;return n._isUTC?(r=n.clone(),o=(v(t)||i(t)?+t:+xt(t))-+r,r._d.setTime(+r._d+o),e.updateOffset(r,!1),r):xt(t).local()}function Ft(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Wt(t,n){var r,i=this._offset||0;return this.isValid()?null!=t?("string"==typeof t?t=Bt(Mr,t):Math.abs(t)<16&&(t=60*t),!this._isUTC&&n&&(r=Ft(this)),this._offset=t,this._isUTC=!0,null!=r&&this.add(r,"m"),i!==t&&(!n||this._changeInProgress?ce(this,re(t-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?i:Ft(this):null!=t?this:NaN}function qt(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Kt(t){return this.utcOffset(0,t)}function Jt(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Ft(this),"m")),this}function $t(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Bt(Or,this._i)),this}function Zt(t){return this.isValid()?(t=t?xt(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function Xt(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Qt(){if(!h(this._isDSTShifted))return this._isDSTShifted;var t={};if(p(t,this),t=kt(t),t._a){var e=t._isUTC?s(t._a):xt(t._a);this._isDSTShifted=this.isValid()&&g(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function te(){return this.isValid()?!this._isUTC:!1}function ee(){return this.isValid()?this._isUTC:!1}function ne(){return this.isValid()?this._isUTC&&0===this._offset:!1}function re(t,e){var n,r,i,o=t,u=null;return Ut(t)?o={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(o={},e?o[e]=t:o.milliseconds=t):(u=ti.exec(t))?(n="-"===u[1]?-1:1,o={y:0,d:m(u[Pr])*n,h:m(u[Ar])*n,m:m(u[kr])*n,s:m(u[Lr])*n,ms:m(u[Nr])*n}):(u=ei.exec(t))?(n="-"===u[1]?-1:1,o={y:ie(u[2],n),M:ie(u[3],n),w:ie(u[4],n),d:ie(u[5],n),h:ie(u[6],n),m:ie(u[7],n),s:ie(u[8],n)}):null==o?o={}:"object"==typeof o&&("from"in o||"to"in o)&&(i=ae(xt(o.from),xt(o.to)),o={},o.ms=i.milliseconds,o.M=i.months),r=new zt(o),Ut(t)&&a(t,"_locale")&&(r._locale=t._locale),r}function ie(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function oe(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function ae(t,e){var n;return t.isValid()&&e.isValid()?(e=Gt(e,t),t.isBefore(e)?n=oe(t,e):(n=oe(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function ue(t){return 0>t?-1*Math.round(-1*t):Math.round(t)}function se(t,e){return function(n,r){var i,o;return null===r||isNaN(+r)||(w(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),o=n,n=r,r=o),n="string"==typeof n?+n:n,i=re(n,r),ce(this,i,t),this}}function ce(t,n,r,i){var o=n._milliseconds,a=ue(n._days),u=ue(n._months);t.isValid()&&(i=null==i?!0:i,o&&t._d.setTime(+t._d+o*r),a&&U(t,"Date",z(t,"Date")+a*r),u&&at(t,z(t,"Month")+u*r),i&&e.updateOffset(t,a||u))}function le(t,e){var n=t||xt(),r=Gt(n,this).startOf("day"),i=this.diff(r,"days",!0),o=-6>i?"sameElse":-1>i?"lastWeek":0>i?"lastDay":1>i?"sameDay":2>i?"nextDay":7>i?"nextWeek":"sameElse",a=e&&(O(e[o])?e[o]():e[o]);return this.format(a||this.localeData().calendar(o,this,xt(n)))}function fe(){return new _(this)}function de(t,e){var n=v(t)?t:xt(t);return this.isValid()&&n.isValid()?(e=R(h(e)?"millisecond":e),"millisecond"===e?+this>+n:+n<+this.clone().startOf(e)):!1}function he(t,e){var n=v(t)?t:xt(t);return this.isValid()&&n.isValid()?(e=R(h(e)?"millisecond":e),"millisecond"===e?+n>+this:+this.clone().endOf(e)<+n):!1}function pe(t,e,n){return this.isAfter(t,n)&&this.isBefore(e,n)}function _e(t,e){var n,r=v(t)?t:xt(t);return this.isValid()&&r.isValid()?(e=R(e||"millisecond"),"millisecond"===e?+this===+r:(n=+r,+this.clone().startOf(e)<=n&&n<=+this.clone().endOf(e))):!1}function ve(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function ye(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function me(t,e,n){var r,i,o,a;return this.isValid()?(r=Gt(t,this),r.isValid()?(i=6e4*(r.utcOffset()-this.utcOffset()),e=R(e),"year"===e||"month"===e||"quarter"===e?(a=ge(this,r),"quarter"===e?a/=3:"year"===e&&(a/=12)):(o=this-r,a="second"===e?o/1e3:"minute"===e?o/6e4:"hour"===e?o/36e5:"day"===e?(o-i)/864e5:"week"===e?(o-i)/6048e5:o),n?a:y(a)):NaN):NaN}function ge(t,e){var n,r,i=12*(e.year()-t.year())+(e.month()-t.month()),o=t.clone().add(i,"months");return 0>e-o?(n=t.clone().add(i-1,"months"),r=(e-o)/(o-n)):(n=t.clone().add(i+1,"months"),r=(e-o)/(n-o)),-(i+r)}function be(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Se(){var t=this.clone().utc();return 0o&&(e=o),qe.call(this,t,e,n,r,i))}function qe(t,e,n,r,i){var o=St(t,e,n,r,i),a=vt(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function Ke(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Je(t){return wt(t,this._week.dow,this._week.doy).week}function $e(){return this._week.dow}function Ze(){return this._week.doy}function Xe(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Qe(t){var e=wt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function tn(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function en(t,e){return r(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]}function nn(t){return this._weekdaysShort[t.day()]}function rn(t){return this._weekdaysMin[t.day()]}function on(t,e,n){var r,i,o;for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;7>r;r++){if(i=xt([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".",".?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[r].test(t))return r;if(n&&"ddd"===e&&this._shortWeekdaysParse[r].test(t))return r;if(n&&"dd"===e&&this._minWeekdaysParse[r].test(t))return r;if(!n&&this._weekdaysParse[r].test(t))return r}}function an(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=tn(t,this.localeData()),this.add(t-e,"d")):e}function un(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function sn(t){return this.isValid()?null==t?this.day()||7:this.day(this.day()%7?t:t-7):null!=t?this:NaN}function cn(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function ln(){return this.hours()%12||12}function fn(t,e){G(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function dn(t,e){return e._meridiemParse}function hn(t){return"p"===(t+"").toLowerCase().charAt(0)}function pn(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}function _n(t,e){e[Nr]=m(1e3*("0."+t))}function vn(){return this._isUTC?"UTC":""}function yn(){return this._isUTC?"Coordinated Universal Time":""}function mn(t){return xt(1e3*t)}function gn(){return xt.apply(null,arguments).parseZone()}function bn(t,e,n){var r=this._calendar[t];return O(r)?r.call(e,n):r}function Sn(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])}function wn(){return this._invalidDate}function On(t){return this._ordinal.replace("%d",t)}function Mn(t){return t}function In(t,e,n,r){var i=this._relativeTime[n];return O(i)?i(t,e,n,r):i.replace(/%d/i,t)}function Tn(t,e){var n=this._relativeTime[t>0?"future":"past"];return O(n)?n(e):n.replace(/%s/i,e)}function En(t,e,n,r){var i=L(),o=s().set(r,e);return i[n](o,t)}function Dn(t,e,n,r,i){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return En(t,e,n,i);var o,a=[];for(o=0;r>o;o++)a[o]=En(t,o,n,i);return a}function jn(t,e){return Dn(t,e,"months",12,"month")}function Cn(t,e){return Dn(t,e,"monthsShort",12,"month")}function Pn(t,e){return Dn(t,e,"weekdays",7,"day")}function An(t,e){return Dn(t,e,"weekdaysShort",7,"day")}function kn(t,e){return Dn(t,e,"weekdaysMin",7,"day")}function Ln(){var t=this._data;return this._milliseconds=Ii(this._milliseconds),this._days=Ii(this._days),this._months=Ii(this._months),t.milliseconds=Ii(t.milliseconds),t.seconds=Ii(t.seconds),t.minutes=Ii(t.minutes),t.hours=Ii(t.hours),t.months=Ii(t.months),t.years=Ii(t.years),this}function Nn(t,e,n,r){var i=re(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function xn(t,e){return Nn(this,t,e,1)}function Rn(t,e){return Nn(this,t,e,-1)}function Hn(t){return 0>t?Math.floor(t):Math.ceil(t)}function Yn(){var t,e,n,r,i,o=this._milliseconds,a=this._days,u=this._months,s=this._data;return o>=0&&a>=0&&u>=0||0>=o&&0>=a&&0>=u||(o+=864e5*Hn(Un(u)+a),a=0,u=0),s.milliseconds=o%1e3,t=y(o/1e3),s.seconds=t%60,e=y(t/60),s.minutes=e%60,n=y(e/60),s.hours=n%24,a+=y(n/24),i=y(zn(a)),u+=i,a-=Hn(Un(i)),r=y(u/12),u%=12,s.days=a,s.months=u,s.years=r,this}function zn(t){return 4800*t/146097}function Un(t){return 146097*t/4800}function Vn(t){var e,n,r=this._milliseconds;if(t=R(t),"month"===t||"year"===t)return e=this._days+r/864e5,n=this._months+zn(e),"month"===t?n:n/12;switch(e=this._days+Math.round(Un(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return 24*e+r/36e5;case"minute":return 1440*e+r/6e4;case"second":return 86400*e+r/1e3;case"millisecond":return Math.floor(864e5*e)+r;default:throw new Error("Unknown unit "+t)}}function Bn(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*m(this._months/12)}function Gn(t){return function(){return this.as(t)}}function Fn(t){return t=R(t),this[t+"s"]()}function Wn(t){return function(){return this._data[t]}}function qn(){return y(this.days()/7)}function Kn(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function Jn(t,e,n){var r=re(t).abs(),i=Ui(r.as("s")),o=Ui(r.as("m")),a=Ui(r.as("h")),u=Ui(r.as("d")),s=Ui(r.as("M")),c=Ui(r.as("y")),l=i=o&&["m"]||o=a&&["h"]||a=u&&["d"]||u=s&&["M"]||s=c&&["y"]||["yy",c];return l[2]=e,l[3]=+t>0,l[4]=n,Kn.apply(null,l)}function $n(t,e){return void 0===Vi[t]?!1:void 0===e?Vi[t]:(Vi[t]=e,!0)}function Zn(t){var e=this.localeData(),n=Jn(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)}function Xn(){var t,e,n,r=Bi(this._milliseconds)/1e3,i=Bi(this._days),o=Bi(this._months);t=y(r/60),e=y(t/60),r%=60,t%=60,n=y(o/12),o%=12;var a=n,u=o,s=i,c=e,l=t,f=r,d=this.asSeconds();return d?(0>d?"-":"")+"P"+(a?a+"Y":"")+(u?u+"M":"")+(s?s+"D":"")+(c||l||f?"T":"")+(c?c+"H":"")+(l?l+"M":"")+(f?f+"S":""):"P0D"}var Qn,tr=e.momentProperties=[],er=!1,nr={};e.suppressDeprecationWarnings=!1;var rr,ir={},or={},ar=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ur=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,sr={},cr={},lr=/\d/,fr=/\d\d/,dr=/\d{3}/,hr=/\d{4}/,pr=/[+-]?\d{6}/,_r=/\d\d?/,vr=/\d\d\d\d?/,yr=/\d\d\d\d\d\d?/,mr=/\d{1,3}/,gr=/\d{1,4}/,br=/[+-]?\d{1,6}/,Sr=/\d+/,wr=/[+-]?\d+/,Or=/Z|[+-]\d\d:?\d\d/gi,Mr=/Z|[+-]\d\d(?::?\d\d)?/gi,Ir=/[+-]?\d+(\.\d{1,3})?/,Tr=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Er={},Dr={},jr=0,Cr=1,Pr=2,Ar=3,kr=4,Lr=5,Nr=6,xr=7,Rr=8;G("M",["MM",2],"Mo",function(){return this.month()+1}),G("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),G("MMMM",0,0,function(t){return this.localeData().months(this,t)}),x("month","M"),J("M",_r),J("MM",_r,fr),J("MMM",function(t,e){return e.monthsShortRegex(t)}),J("MMMM",function(t,e){return e.monthsRegex(t)}),Q(["M","MM"],function(t,e){e[Cr]=m(t)-1}),Q(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);null!=i?e[Cr]=i:l(n).invalidMonth=t});var Hr=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Yr="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),zr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Ur=Tr,Vr=Tr,Br=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Gr=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Fr=/Z|[+-]\d\d(?::?\d\d)?/,Wr=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],qr=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Kr=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=S("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),G("Y",0,0,function(){var t=this.year();return 9999>=t?""+t:"+"+t}),G(0,["YY",2],0,function(){return this.year()%100}),G(0,["YYYY",4],0,"year"),G(0,["YYYYY",5],0,"year"),G(0,["YYYYYY",6,!0],0,"year"),x("year","y"),J("Y",wr),J("YY",_r,fr),J("YYYY",gr,hr),J("YYYYY",br,pr),J("YYYYYY",br,pr),Q(["YYYYY","YYYYYY"],jr),Q("YYYY",function(t,n){n[jr]=2===t.length?e.parseTwoDigitYear(t):m(t)}),Q("YY",function(t,n){n[jr]=e.parseTwoDigitYear(t)}),Q("Y",function(t,e){e[jr]=parseInt(t,10)}),e.parseTwoDigitYear=function(t){return m(t)+(m(t)>68?1900:2e3)};var Jr=Y("FullYear",!1);e.ISO_8601=function(){};var $r=S("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=xt.apply(null,arguments);return this.isValid()&&t.isValid()?this>t?this:t:d()}),Zr=S("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=xt.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:d()}),Xr=function(){return Date.now?Date.now():+new Date};Vt("Z",":"),Vt("ZZ",""),J("Z",Mr),J("ZZ",Mr),Q(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Bt(Mr,t)});var Qr=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var ti=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,ei=/^(-)?P(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)W)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?$/;re.fn=zt.prototype;var ni=se(1,"add"),ri=se(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var ii=S("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});G(0,["gg",2],0,function(){return this.weekYear()%100}),G(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ue("gggg","weekYear"),Ue("ggggg","weekYear"),Ue("GGGG","isoWeekYear"),Ue("GGGGG","isoWeekYear"),x("weekYear","gg"),x("isoWeekYear","GG"),J("G",wr),J("g",wr),J("GG",_r,fr),J("gg",_r,fr),J("GGGG",gr,hr),J("gggg",gr,hr),J("GGGGG",br,pr),J("ggggg",br,pr),tt(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=m(t)}),tt(["gg","GG"],function(t,n,r,i){n[i]=e.parseTwoDigitYear(t)}),G("Q",0,"Qo","quarter"),x("quarter","Q"),J("Q",lr),Q("Q",function(t,e){e[Cr]=3*(m(t)-1)}),G("w",["ww",2],"wo","week"),G("W",["WW",2],"Wo","isoWeek"),x("week","w"),x("isoWeek","W"),J("w",_r),J("ww",_r,fr),J("W",_r),J("WW",_r,fr),tt(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=m(t)});var oi={dow:0,doy:6};G("D",["DD",2],"Do","date"),x("date","D"),J("D",_r),J("DD",_r,fr),J("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),Q(["D","DD"],Pr),Q("Do",function(t,e){e[Pr]=m(t.match(_r)[0],10)});var ai=Y("Date",!0);G("d",0,"do","day"),G("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),G("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),G("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),G("e",0,0,"weekday"),G("E",0,0,"isoWeekday"),x("day","d"),x("weekday","e"),x("isoWeekday","E"),J("d",_r),J("e",_r),J("E",_r),J("dd",Tr),J("ddd",Tr),J("dddd",Tr),tt(["dd","ddd","dddd"],function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);null!=i?e.d=i:l(n).invalidWeekday=t}),tt(["d","e","E"],function(t,e,n,r){e[r]=m(t)});var ui="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),si="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),ci="Su_Mo_Tu_We_Th_Fr_Sa".split("_");G("DDD",["DDDD",3],"DDDo","dayOfYear"),x("dayOfYear","DDD"),J("DDD",mr),J("DDDD",dr),Q(["DDD","DDDD"],function(t,e,n){n._dayOfYear=m(t)}),G("H",["HH",2],0,"hour"),G("h",["hh",2],0,ln),G("hmm",0,0,function(){return""+ln.apply(this)+B(this.minutes(),2)}),G("hmmss",0,0,function(){return""+ln.apply(this)+B(this.minutes(),2)+B(this.seconds(),2)}),G("Hmm",0,0,function(){return""+this.hours()+B(this.minutes(),2)}),G("Hmmss",0,0,function(){return""+this.hours()+B(this.minutes(),2)+B(this.seconds(),2)}),fn("a",!0),fn("A",!1),x("hour","h"),J("a",dn),J("A",dn),J("H",_r),J("h",_r),J("HH",_r,fr),J("hh",_r,fr),J("hmm",vr),J("hmmss",yr),J("Hmm",vr),J("Hmmss",yr),Q(["H","HH"],Ar),Q(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),Q(["h","hh"],function(t,e,n){e[Ar]=m(t),l(n).bigHour=!0}),Q("hmm",function(t,e,n){var r=t.length-2;e[Ar]=m(t.substr(0,r)),e[kr]=m(t.substr(r)),l(n).bigHour=!0}),Q("hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[Ar]=m(t.substr(0,r)),e[kr]=m(t.substr(r,2)),e[Lr]=m(t.substr(i)),l(n).bigHour=!0}),Q("Hmm",function(t,e,n){var r=t.length-2;e[Ar]=m(t.substr(0,r)),e[kr]=m(t.substr(r))}),Q("Hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[Ar]=m(t.substr(0,r)),e[kr]=m(t.substr(r,2)),e[Lr]=m(t.substr(i))});var li=/[ap]\.?m?\.?/i,fi=Y("Hours",!0);G("m",["mm",2],0,"minute"),x("minute","m"),J("m",_r),J("mm",_r,fr),Q(["m","mm"],kr);var di=Y("Minutes",!1);G("s",["ss",2],0,"second"),x("second","s"),J("s",_r),J("ss",_r,fr),Q(["s","ss"],Lr);var hi=Y("Seconds",!1);G("S",0,0,function(){return~~(this.millisecond()/100)}),G(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),G(0,["SSS",3],0,"millisecond"),G(0,["SSSS",4],0,function(){return 10*this.millisecond()}),G(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),G(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),G(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),G(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),G(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),x("millisecond","ms"),J("S",mr,lr),J("SS",mr,fr),J("SSS",mr,dr);var pi;for(pi="SSSS";pi.length<=9;pi+="S")J(pi,Sr);for(pi="S";pi.length<=9;pi+="S")Q(pi,_n);var _i=Y("Milliseconds",!1);G("z",0,0,"zoneAbbr"),G("zz",0,0,"zoneName");var vi=_.prototype;vi.add=ni,vi.calendar=le,vi.clone=fe,vi.diff=me,vi.endOf=Ce,vi.format=we,vi.from=Oe,vi.fromNow=Me,vi.to=Ie,vi.toNow=Te,vi.get=V,vi.invalidAt=Ye,vi.isAfter=de,vi.isBefore=he,vi.isBetween=pe,vi.isSame=_e,vi.isSameOrAfter=ve,vi.isSameOrBefore=ye,vi.isValid=Re,vi.lang=ii,vi.locale=Ee,vi.localeData=De,vi.max=Zr,vi.min=$r,vi.parsingFlags=He,vi.set=V,vi.startOf=je,vi.subtract=ri,vi.toArray=Le,vi.toObject=Ne,vi.toDate=ke,vi.toISOString=Se,vi.toJSON=xe,vi.toString=be,vi.unix=Ae,vi.valueOf=Pe,vi.creationData=ze,vi.year=Jr,vi.isLeapYear=gt,vi.weekYear=Ve,vi.isoWeekYear=Be,vi.quarter=vi.quarters=Ke,vi.month=ut,vi.daysInMonth=st,vi.week=vi.weeks=Xe,vi.isoWeek=vi.isoWeeks=Qe,vi.weeksInYear=Fe,vi.isoWeeksInYear=Ge,vi.date=ai,vi.day=vi.days=an,vi.weekday=un,vi.isoWeekday=sn,vi.dayOfYear=cn,vi.hour=vi.hours=fi,vi.minute=vi.minutes=di,vi.second=vi.seconds=hi,vi.millisecond=vi.milliseconds=_i,vi.utcOffset=Wt,vi.utc=Kt,vi.local=Jt,vi.parseZone=$t,vi.hasAlignedHourOffset=Zt,vi.isDST=Xt,vi.isDSTShifted=Qt,vi.isLocal=te,vi.isUtcOffset=ee,vi.isUtc=ne,vi.isUTC=ne,vi.zoneAbbr=vn,vi.zoneName=yn,vi.dates=S("dates accessor is deprecated. Use date instead.",ai),vi.months=S("months accessor is deprecated. Use month instead",ut),vi.years=S("years accessor is deprecated. Use year instead",Jr),vi.zone=S("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",qt);var yi=vi,mi={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},gi={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},bi="Invalid date",Si="%d",wi=/\d{1,2}/,Oi={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Mi=E.prototype;Mi._calendar=mi,Mi.calendar=bn,Mi._longDateFormat=gi,Mi.longDateFormat=Sn,Mi._invalidDate=bi,Mi.invalidDate=wn,Mi._ordinal=Si,Mi.ordinal=On,Mi._ordinalParse=wi,Mi.preparse=Mn,Mi.postformat=Mn,Mi._relativeTime=Oi,Mi.relativeTime=In,Mi.pastFuture=Tn,Mi.set=I,Mi.months=rt,Mi._months=Yr,Mi.monthsShort=it,Mi._monthsShort=zr,Mi.monthsParse=ot,Mi._monthsRegex=Vr,Mi.monthsRegex=lt,Mi._monthsShortRegex=Ur,Mi.monthsShortRegex=ct,Mi.week=Je,Mi._week=oi,Mi.firstDayOfYear=Ze,Mi.firstDayOfWeek=$e,Mi.weekdays=en,Mi._weekdays=ui,Mi.weekdaysMin=rn,Mi._weekdaysMin=ci,Mi.weekdaysShort=nn,Mi._weekdaysShort=si,Mi.weekdaysParse=on,Mi.isPM=hn,Mi._meridiemParse=li,Mi.meridiem=pn,P("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=1===m(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n}}),e.lang=S("moment.lang is deprecated. Use moment.locale instead.",P),e.langData=S("moment.langData is deprecated. Use moment.localeData instead.",L);var Ii=Math.abs,Ti=Gn("ms"),Ei=Gn("s"),Di=Gn("m"),ji=Gn("h"),Ci=Gn("d"),Pi=Gn("w"),Ai=Gn("M"),ki=Gn("y"),Li=Wn("milliseconds"),Ni=Wn("seconds"),xi=Wn("minutes"),Ri=Wn("hours"),Hi=Wn("days"),Yi=Wn("months"),zi=Wn("years"),Ui=Math.round,Vi={s:45,m:45,h:22,d:26,M:11},Bi=Math.abs,Gi=zt.prototype;Gi.abs=Ln,Gi.add=xn,Gi.subtract=Rn,Gi.as=Vn,Gi.asMilliseconds=Ti,Gi.asSeconds=Ei,Gi.asMinutes=Di,Gi.asHours=ji,Gi.asDays=Ci,Gi.asWeeks=Pi,Gi.asMonths=Ai,Gi.asYears=ki,Gi.valueOf=Bn,Gi._bubble=Yn,Gi.get=Fn,Gi.milliseconds=Li,Gi.seconds=Ni,Gi.minutes=xi,Gi.hours=Ri,Gi.days=Hi,Gi.weeks=qn,Gi.months=Yi,Gi.years=zi,Gi.humanize=Zn,Gi.toISOString=Xn,Gi.toString=Xn,Gi.toJSON=Xn,Gi.locale=Ee,Gi.localeData=De,Gi.toIsoString=S("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Xn),Gi.lang=ii,G("X",0,0,"unix"),G("x",0,0,"valueOf"),J("x",wr),J("X",Ir),Q("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),Q("x",function(t,e,n){n._d=new Date(m(t))}),e.version="2.12.0",n(xt),e.fn=yi,e.min=Ht,e.max=Yt,e.now=Xr,e.utc=s,e.unix=mn,e.months=jn,e.isDate=i,e.locale=P,e.invalid=d,e.duration=re,e.isMoment=v,e.weekdays=Pn,e.parseZone=gn,e.localeData=L,e.isDuration=Ut,e.monthsShort=Cn,e.weekdaysMin=kn,e.defineLocale=A,e.updateLocale=k,e.locales=N,e.weekdaysShort=An,e.normalizeUnits=R,e.relativeTimeThreshold=$n,e.prototype=yi;var Fi=e;return Fi})}).call(e,n(69)(t))},function(t,e){"use strict";function n(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(t,e){for(var o,a,u=n(t),s=1;s199&&r.status<300?t(e):n(e)},r.onerror=function(){return n({})},o?r.send(JSON.stringify(o)):r.send()})};e["default"]=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],r=n.useStreaming,i=void 0===r?t.evaluate(c.getters.isSupported):r,o=n.rememberAuth,a=void 0===o?!1:o,s=n.host,d=void 0===s?"":s;t.dispatch(u["default"].VALIDATING_AUTH_TOKEN,{authToken:e,host:d}),l.actions.fetchAll(t).then(function(){t.dispatch(u["default"].VALID_AUTH_TOKEN,{authToken:e,host:d,rememberAuth:a}),i?c.actions.start(t,{syncOnInitialConnect:!1}):l.actions.start(t,{skipInitialSync:!0})},function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=e.message,r=void 0===n?f:n;t.dispatch(u["default"].INVALID_AUTH_TOKEN,{errorMessage:r})})}function o(t){(0,s.callApi)(t,"POST","log_out"),t.dispatch(u["default"].LOG_OUT,{})}Object.defineProperty(e,"__esModule",{value:!0}),e.validate=i,e.logOut=o;var a=n(14),u=r(a),s=n(5),c=n(24),l=n(26),f="Unexpected result from API"},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=e.isValidating=["authAttempt","isValidating"],r=(e.isInvalidAttempt=["authAttempt","isInvalid"],e.attemptErrorMessage=["authAttempt","errorMessage"],e.rememberAuth=["rememberAuth"],e.attemptAuthInfo=[["authAttempt","authToken"],["authAttempt","host"],function(t,e){return{authToken:t,host:e}}]),i=e.currentAuthToken=["authCurrent","authToken"],o=e.currentAuthInfo=[i,["authCurrent","host"],function(t,e){return{authToken:t,host:e}}];e.authToken=[n,["authAttempt","authToken"],["authCurrent","authToken"],function(t,e,n){return t?e:n}],e.authInfo=[n,r,o,function(t,e,n){return t?e:n}]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(null==t)throw new TypeError("Cannot destructure undefined")}function o(t,e){var n=e.authToken,r=e.host;return(0,s.toImmutable)({authToken:n,host:r,isValidating:!0,isInvalid:!1,errorMessage:""})}function a(t,e){return i(e),f.getInitialState()}function u(t,e){var n=e.errorMessage;return t.withMutations(function(t){return t.set("isValidating",!1).set("isInvalid",!0).set("errorMessage",n)})}Object.defineProperty(e,"__esModule",{value:!0});var s=n(3),c=n(14),l=r(c),f=new s.Store({getInitialState:function(){return(0,s.toImmutable)({isValidating:!1,authToken:!1,host:null,isInvalid:!1,errorMessage:""})},initialize:function(){this.on(l["default"].VALIDATING_AUTH_TOKEN,o),this.on(l["default"].VALID_AUTH_TOKEN,a),this.on(l["default"].INVALID_AUTH_TOKEN,u)}});e["default"]=f},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=e.authToken,r=e.host;return(0,a.toImmutable)({authToken:n,host:r})}function o(){return c.getInitialState()}Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),u=n(14),s=r(u),c=new a.Store({getInitialState:function(){return(0,a.toImmutable)({authToken:null,host:""})},initialize:function(){this.on(s["default"].VALID_AUTH_TOKEN,i),this.on(s["default"].LOG_OUT,o)}});e["default"]=c},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=e.rememberAuth;return n}Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),a=n(14),u=r(a),s=new o.Store({getInitialState:function(){return!0},initialize:function(){this.on(u["default"].VALID_AUTH_TOKEN,i)}});e["default"]=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){t.dispatch(c["default"].SERVER_CONFIG_LOADED,e)}function o(t){(0,u.callApi)(t,"GET","config").then(function(e){return i(t,e)})}function a(t,e){t.dispatch(c["default"].COMPONENT_LOADED,{component:e})}Object.defineProperty(e,"__esModule",{value:!0}),e.configLoaded=i,e.fetchAll=o,e.componentLoaded=a;var u=n(5),s=n(18),c=r(s)},function(t,e){"use strict";function n(t){return[["serverComponent"],function(e){return e.contains(t)}]}Object.defineProperty(e,"__esModule",{value:!0}),e.isComponentLoaded=n,e.locationGPS=[["serverConfig","latitude"],["serverConfig","longitude"],function(t,e){return{latitude:t,longitude:e}}],e.locationName=["serverConfig","location_name"],e.serverVersion=["serverConfig","serverVersion"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=e.component;return t.push(n)}function o(t,e){var n=e.components;return(0,u.toImmutable)(n)}function a(){return l.getInitialState()}Object.defineProperty(e,"__esModule",{value:!0});var u=n(3),s=n(18),c=r(s),l=new u.Store({getInitialState:function(){return(0,u.toImmutable)([])},initialize:function(){this.on(c["default"].COMPONENT_LOADED,i),this.on(c["default"].SERVER_CONFIG_LOADED,o),this.on(c["default"].LOG_OUT,a)}});e["default"]=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=e.latitude,r=e.longitude,i=e.location_name,o=e.temperature_unit,u=e.time_zone,s=e.version;return(0,a.toImmutable)({latitude:n,longitude:r,location_name:i,temperature_unit:o,time_zone:u,serverVersion:s})}function o(){return c.getInitialState()}Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),u=n(18),s=r(u),c=new a.Store({getInitialState:function(){return(0,a.toImmutable)({latitude:null,longitude:null,location_name:"Home",temperature_unit:"°C",time_zone:"UTC",serverVersion:"unknown"})},initialize:function(){this.on(s["default"].SERVER_CONFIG_LOADED,i),this.on(s["default"].LOG_OUT,o)}});e["default"]=c},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){t.dispatch(f["default"].ENTITY_HISTORY_DATE_SELECTED,{date:e})}function a(t){var e=arguments.length<=1||void 0===arguments[1]?null:arguments[1];t.dispatch(f["default"].RECENT_ENTITY_HISTORY_FETCH_START,{});var n="history/period";return null!==e&&(n+="?filter_entity_id="+e),(0,c.callApi)(t,"GET",n).then(function(e){return t.dispatch(f["default"].RECENT_ENTITY_HISTORY_FETCH_SUCCESS,{stateHistory:e})},function(){return t.dispatch(f["default"].RECENT_ENTITY_HISTORY_FETCH_ERROR,{})})}function u(t,e){return t.dispatch(f["default"].ENTITY_HISTORY_FETCH_START,{date:e}),(0,c.callApi)(t,"GET","history/period/"+e).then(function(n){return t.dispatch(f["default"].ENTITY_HISTORY_FETCH_SUCCESS,{date:e,stateHistory:n})},function(){return t.dispatch(f["default"].ENTITY_HISTORY_FETCH_ERROR,{})})}function s(t){var e=t.evaluate(h.currentDate);return u(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.changeCurrentDate=o,e.fetchRecent=a,e.fetchDate=u,e.fetchSelectedDate=s;var c=n(5),l=n(11),f=i(l),d=n(38),h=r(d)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=e.date;return(0,s["default"])(n)}function o(){return f.getInitialState()}Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),u=n(27),s=r(u),c=n(11),l=r(c),f=new a.Store({getInitialState:function(){var t=new Date;return t.setDate(t.getDate()-1),(0,s["default"])(t)},initialize:function(){this.on(l["default"].ENTITY_HISTORY_DATE_SELECTED,i),this.on(l["default"].LOG_OUT,o)}});e["default"]=f},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=e.date,r=e.stateHistory;return 0===r.length?t.set(n,(0,a.toImmutable)({})):t.withMutations(function(t){r.forEach(function(e){return t.setIn([n,e[0].entity_id],(0,a.toImmutable)(e.map(l["default"].fromJSON)))})})}function o(){return f.getInitialState()}Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),u=n(11),s=r(u),c=n(16),l=r(c),f=new a.Store({getInitialState:function(){return(0,a.toImmutable)({})},initialize:function(){this.on(s["default"].ENTITY_HISTORY_FETCH_SUCCESS,i),this.on(s["default"].LOG_OUT,o)}});e["default"]=f},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),o=n(11),a=r(o),u=new i.Store({getInitialState:function(){return!1},initialize:function(){this.on(a["default"].ENTITY_HISTORY_FETCH_START,function(){return!0}),this.on(a["default"].ENTITY_HISTORY_FETCH_SUCCESS,function(){return!1}),this.on(a["default"].ENTITY_HISTORY_FETCH_ERROR,function(){return!1}),this.on(a["default"].RECENT_ENTITY_HISTORY_FETCH_START,function(){return!0}),this.on(a["default"].RECENT_ENTITY_HISTORY_FETCH_SUCCESS,function(){ return!1}),this.on(a["default"].RECENT_ENTITY_HISTORY_FETCH_ERROR,function(){return!1}),this.on(a["default"].LOG_OUT,function(){return!1})}});e["default"]=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=e.stateHistory;return t.withMutations(function(t){n.forEach(function(e){return t.set(e[0].entity_id,(0,a.toImmutable)(e.map(l["default"].fromJSON)))})})}function o(){return f.getInitialState()}Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),u=n(11),s=r(u),c=n(16),l=r(c),f=new a.Store({getInitialState:function(){return(0,a.toImmutable)({})},initialize:function(){this.on(s["default"].RECENT_ENTITY_HISTORY_FETCH_SUCCESS,i),this.on(s["default"].LOG_OUT,o)}});e["default"]=f},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=e.stateHistory,r=(new Date).getTime();return t.withMutations(function(t){n.forEach(function(e){return t.set(e[0].entity_id,r)}),history.length>1&&t.set(c,r)})}function o(){return l.getInitialState()}Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),u=n(11),s=r(u),c="ALL_ENTRY_FETCH",l=new a.Store({getInitialState:function(){return(0,a.toImmutable)({})},initialize:function(){this.on(s["default"].RECENT_ENTITY_HISTORY_FETCH_SUCCESS,i),this.on(s["default"].LOG_OUT,o)}});e["default"]=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(10),o=n(16),a=r(o),u=(0,i.createApiActions)(a["default"]);e["default"]=u},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;no}Object.defineProperty(e,"__esModule",{value:!0}),e.isLoadingEntries=e.currentEntries=e.isCurrentStale=e.currentDate=void 0;var i=n(3),o=6e4,a=e.currentDate=["currentLogbookDate"];e.isCurrentStale=[a,["logbookEntriesUpdated"],function(t,e){return r(e.get(t))}],e.currentEntries=[a,["logbookEntries"],function(t,e){return e.get(t)||(0,i.toImmutable)([])}],e.isLoadingEntries=["isLoadingLogbookEntries"]},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}function o(t){t.registerStores({currentLogbookDate:u["default"],isLoadingLogbookEntries:c["default"],logbookEntries:f["default"],logbookEntriesUpdated:h["default"]})}Object.defineProperty(e,"__esModule",{value:!0}),e.getters=e.actions=void 0,e.register=o;var a=n(98),u=i(a),s=n(99),c=i(s),l=n(100),f=i(l),d=n(101),h=i(d),p=n(94),_=r(p),v=n(95),y=r(v);e.actions=_,e.getters=y},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n1}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(56),e["default"]=new o["default"]({is:"ha-introduction-card",properties:{showInstallInstruction:{type:Boolean,value:!1},showHideInstruction:{type:Boolean,value:!0}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a),s=u["default"].moreInfoActions;e["default"]=new o["default"]({is:"ha-media_player-card",properties:{stateObj:{type:Object},playerObj:{type:Object,computed:"computePlayerObj(stateObj)",observer:"playerObjChanged"},imageLoaded:{type:Boolean,value:!0},playbackControlIcon:{type:String,computed:"computePlaybackControlIcon(playerObj)"},elevation:{type:Number,value:1,reflectToAttribute:!0}},playerObjChanged:function(t){this.style.height=this.computeShowControls(t)?"175px":"78px",this.style.backgroundImage=t.stateObj.attributes.entity_picture?"url("+t.stateObj.attributes.entity_picture+")":""},imageLoadSuccess:function(){this.imageLoaded=!0},imageLoadFail:function(){this.imageLoaded=!1},computeHidePowerOnButton:function(t){return!t.isOff||!t.supportsTurnOn},computePlayerObj:function(t){return t.domainModel(u["default"])},computePlaybackControlIcon:function(t){return t.isPlaying?t.supportsPause?"mdi:pause":"mdi:stop":t.isPaused?"mdi:play":""},computeShowControls:function(t){return!t.isOff},computeVolumeMuteIcon:function(t){return t.isMuted?"mdi:volume-high":"mdi:volume-off"},handleNext:function(t){t.stopPropagation(),this.playerObj.nextTrack()},handleOpenMoreInfo:function(t){var e=this;t.stopPropagation(),this.async(function(){return s.selectEntity(e.stateObj.entityId)},1)},handlePlaybackControl:function(t){t.stopPropagation(),this.playerObj.mediaPlayPause()},handlePrevious:function(t){t.stopPropagation(),this.playerObj.previousTrack()},handlePowerOff:function(t){t.stopPropagation(),this.playerObj.turnOff()},handlePowerOn:function(t){t.stopPropagation(),this.playerObj.turnOn()},handleVolumeMute:function(t){t.stopPropagation(),this.playerObj.volumeMute(!this.playerObj.isMuted)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(61),u=r(a);e["default"]=new o["default"]({is:"display-time",properties:{dateObj:{type:Object}},computeTime:function(t){return t?(0,u["default"])(t):""}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s),l=o["default"].entityGetters;e["default"]=new u["default"]({is:"entity-list",behaviors:[c["default"]],properties:{entities:{type:Array,bindNuclear:[l.entityMap,function(t){return t.valueSeq().sortBy(function(t){return t.entityId}).toArray()}]}},entitySelected:function(t){t.preventDefault(),this.fire("entity-selected",{entityId:t.model.entity.entityId})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a);n(30);var s=u["default"].reactor,c=u["default"].entityGetters,l=u["default"].moreInfoActions;e["default"]=new o["default"]({is:"ha-entity-marker",properties:{entityId:{type:String,value:""},state:{type:Object,computed:"computeState(entityId)"},icon:{type:Object,computed:"computeIcon(state)"},image:{type:Object,computed:"computeImage(state)"},value:{type:String,computed:"computeValue(state)"}},listeners:{tap:"badgeTap"},badgeTap:function(t){var e=this;t.stopPropagation(),this.entityId&&this.async(function(){return l.selectEntity(e.entityId)},1)},computeState:function(t){return t&&s.evaluate(c.byId(t))},computeIcon:function(t){return!t&&"home"},computeImage:function(t){return t&&t.attributes.entity_picture},computeValue:function(t){return t&&t.entityDisplay.split(" ").map(function(t){return t.substr(0,1)}).join("")}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(63),u=r(a);e["default"]=new o["default"]({is:"ha-state-icon",properties:{stateObj:{type:Object}},computeIcon:function(t){return(0,u["default"])(t)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a),s=n(35),c=r(s),l=n(34),f=r(l),d=n(63),h=r(d);n(30);var p=u["default"].moreInfoActions,_=u["default"].serviceActions;e["default"]=new o["default"]({is:"ha-state-label-badge",properties:{state:{type:Object,observer:"stateChanged"}},listeners:{tap:"badgeTap"},badgeTap:function(t){var e=this;return t.stopPropagation(),(0,f["default"])(this.state.entityId)?void("scene"===this.state.domain||"off"===this.state.state?_.callTurnOn(this.state.entityId):_.callTurnOff(this.state.entityId)):void this.async(function(){return p.selectEntity(e.state.entityId)},1)},computeClasses:function(t){switch(t.domain){case"scene":return"green";case"binary_sensor":case"script":return"on"===t.state?"blue":"grey";case"updater":return"blue";default:return""}},computeValue:function(t){switch(t.domain){case"binary_sensor":case"device_tracker":case"updater":case"sun":case"scene":case"script":case"alarm_control_panel":return null;case"sensor":default:return"unknown"===t.state?"-":t.state}},computeIcon:function(t){switch(t.domain){case"alarm_control_panel":return"pending"===t.state?"mdi:clock-fast":"armed_away"===t.state?"mdi:nature":"armed_home"===t.state?"mdi:home-variant":(0,c["default"])(t.domain,t.state);case"binary_sensor":case"device_tracker":case"scene":case"updater":case"script":return(0,h["default"])(t);case"sun":return"above_horizon"===t.state?(0,c["default"])(t.domain):"mdi:brightness-3";default:return null}},computeImage:function(t){return t.attributes.entity_picture||null},computeLabel:function(t){switch(t.domain){case"scene":case"script":return t.domain;case"device_tracker":return"not_home"===t.state?"Away":t.state;case"alarm_control_panel":return"pending"===t.state?"pend":"armed_away"===t.state||"armed_home"===t.state?"armed":"disarm";default:return t.attributes.unit_of_measurement||null}},computeDescription:function(t){return t.entityDisplay},stateChanged:function(){this.updateStyles()}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(150),e["default"]=new o["default"]({is:"state-badge",properties:{stateObj:{type:Object,observer:"updateIconColor"}},updateIconColor:function(t){return t.attributes.entity_picture?(this.style.backgroundImage="url("+t.attributes.entity_picture+")",void(this.$.icon.style.display="none")):(this.style.backgroundImage="",this.$.icon.style.display="inline",void("light"===t.domain&&"on"===t.state&&t.attributes.rgb_color&&t.attributes.rgb_color.reduce(function(t,e){return t+e},0)<730?this.$.icon.style.color="rgb("+t.attributes.rgb_color.join(",")+")":this.$.icon.style.color=null))}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s),l=o["default"].eventGetters;e["default"]=new u["default"]({is:"events-list",behaviors:[c["default"]],properties:{events:{type:Array,bindNuclear:[l.entityMap,function(t){return t.valueSeq().sortBy(function(t){return t.event}).toArray()}]}},eventSelected:function(t){t.preventDefault(),this.fire("event-selected",{eventType:t.model.event.event})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){return t in d?d[t]:30}function o(t){return"group"===t.domain?t.attributes.order:t.entityDisplay.toLowerCase()}Object.defineProperty(e,"__esModule",{value:!0});var a=n(1),u=r(a),s=n(2),c=r(s);n(156),n(141),n(143);var l=c["default"].util,f=["camera","media_player"],d={configurator:-20,group:-10,a:-1,updater:0,sun:1,device_tracker:2,alarm_control_panel:3,sensor:5,binary_sensor:6,scene:7,script:8};e["default"]=new u["default"]({is:"ha-cards",properties:{showIntroduction:{type:Boolean,value:!1},columns:{type:Number,value:2},states:{type:Object},cards:{type:Object}},observers:["updateCards(columns, states, showIntroduction)"],updateCards:function(t,e,n){var r=this;this.debounce("updateCards",function(){r.cards=r.computeCards(t,e,n)},0)},computeCards:function(t,e,n){function r(t){return t.filter(function(t){return!(t.entityId in c)})}function a(){var e=p;return p=(p+1)%t,e}function u(t,e){var n=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];if(0!==e.length){var r=[],i=[];e.forEach(function(t){-1===f.indexOf(t.domain)?i.push(t):r.push(t)});var o=a();i.length>0&&(d._columns[o].push(t),d[t]={cardType:"entities",states:i,groupEntity:n}),r.forEach(function(t){d._columns[o].push(t.entityId),d[t.entityId]={cardType:t.domain,stateObj:t}})}}for(var s=e.groupBy(function(t){return t.domain}),c={},d={_demo:!1,_badges:[],_columns:[]},h=0;t>h;h++)d._columns[h]=[];var p=0;return n&&(d._columns[a()].push("ha-introduction"),d["ha-introduction"]={cardType:"introduction",showHideInstruction:e.size>0&&!0}),s.keySeq().sortBy(function(t){return i(t)}).forEach(function(t){if("a"===t)return void(d._demo=!0);var n=i(t);n>=0&&10>n?d._badges.push.apply(d._badges,r(s.get(t)).sortBy(o).toArray()):"group"===t?s.get(t).sortBy(o).forEach(function(t){var n=l.expandGroup(t,e);n.forEach(function(t){c[t.entityId]=!0}),u(t.entityId,n.toArray(),t)}):u(t,r(s.get(t)).sortBy(o).toArray())}),d},computeCardDataOfCard:function(t,e){return t[e]}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);e["default"]=new o["default"]({is:"ha-color-picker",properties:{color:{type:Object},width:{type:Number},height:{type:Number}},listeners:{mousedown:"onMouseDown",mouseup:"onMouseUp",touchstart:"onTouchStart",touchend:"onTouchEnd"},onMouseDown:function(t){this.onMouseMove(t),this.addEventListener("mousemove",this.onMouseMove)},onMouseUp:function(){this.removeEventListener("mousemove",this.onMouseMove)},onTouchStart:function(t){this.onTouchMove(t),this.addEventListener("touchmove",this.onTouchMove)},onTouchEnd:function(){this.removeEventListener("touchmove",this.onTouchMove)},onTouchMove:function(t){var e=this;this.mouseMoveIsThrottled&&(this.mouseMoveIsThrottled=!1,this.processColorSelect(t.touches[0]),this.async(function(){e.mouseMoveIsThrottled=!0},100))},onMouseMove:function(t){var e=this;this.mouseMoveIsThrottled&&(this.mouseMoveIsThrottled=!1,this.processColorSelect(t),this.async(function(){e.mouseMoveIsThrottled=!0},100))},processColorSelect:function(t){var e=this.canvas.getBoundingClientRect();t.clientX=e.left+e.width||t.clientY=e.top+e.height||this.onColorSelect(t.clientX-e.left,t.clientY-e.top)},onColorSelect:function(t,e){var n=this.context.getImageData(t,e,1,1).data;this.setColor({r:n[0],g:n[1],b:n[2]})},setColor:function(t){this.color=t,this.fire("colorselected",{rgb:this.color})},ready:function(){this.setColor=this.setColor.bind(this),this.mouseMoveIsThrottled=!0,this.canvas=this.children[0],this.context=this.canvas.getContext("2d"),this.drawGradient()},drawGradient:function(){var t=void 0;this.width&&this.height||(t=getComputedStyle(this));var e=this.width||parseInt(t.width,10),n=this.height||parseInt(t.height,10),r=this.context.createLinearGradient(0,0,e,0);r.addColorStop(0,"rgb(255,0,0)"),r.addColorStop(.16,"rgb(255,0,255)"),r.addColorStop(.32,"rgb(0,0,255)"),r.addColorStop(.48,"rgb(0,255,255)"),r.addColorStop(.64,"rgb(0,255,0)"),r.addColorStop(.8,"rgb(255,255,0)"),r.addColorStop(1,"rgb(255,0,0)"),this.context.fillStyle=r,this.context.fillRect(0,0,e,n);var i=this.context.createLinearGradient(0,0,0,n);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(.5,"rgba(255,255,255,0)"),i.addColorStop(.5,"rgba(0,0,0,0)"),i.addColorStop(1,"rgba(0,0,0,1)"),this.context.fillStyle=i,this.context.fillRect(0,0,e,n)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(30),e["default"]=new o["default"]({is:"ha-demo-badge"})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(159),e["default"]=new o["default"]({is:"ha-logbook",properties:{entries:{type:Object,value:[]}},noEntries:function(t){return!t.length}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(163);var l=o["default"].configGetters,f=o["default"].navigationGetters,d=o["default"].authActions,h=o["default"].navigationActions;e["default"]=new u["default"]({is:"ha-sidebar",behaviors:[c["default"]],properties:{menuShown:{type:Boolean},menuSelected:{type:String},narrow:{type:Boolean},selected:{type:String,bindNuclear:f.activePane},hasHistoryComponent:{type:Boolean,bindNuclear:l.isComponentLoaded("history")},hasLogbookComponent:{type:Boolean,bindNuclear:l.isComponentLoaded("logbook")}},menuSelect:function(){var t=this;this.debounce("updateStyles",function(){return t.updateStyles()},1)},menuClicked:function(t){for(var e=t.target,n=5;n&&!e.getAttribute("data-panel");)e=e.parentElement,n--;n&&this.selectPanel(e.getAttribute("data-panel"))},toggleMenu:function(){this.fire("close-menu")},selectPanel:function(t){var e=this;if(t!==this.selected){if("logout"===t)return void this.handleLogOut();h.navigate.apply(null,t.split("/")),this.debounce("updateStyles",function(){return e.updateStyles()},1)}},handleLogOut:function(){d.logOut()}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a);n(55),n(147),n(57);var s=o["default"].moreInfoActions;e["default"]=new u["default"]({is:"logbook-entry",entityClicked:function(t){t.preventDefault(),s.selectEntity(this.entryObj.entityId)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(55);var l=o["default"].serviceGetters;e["default"]=new u["default"]({is:"services-list",behaviors:[c["default"]],properties:{serviceDomains:{type:Array,bindNuclear:l.entityMap}},computeDomains:function(t){return t.valueSeq().map(function(t){return t.domain}).sort().toJS()},computeServices:function(t,e){return t.get(e).get("services").keySeq().toArray()},serviceClicked:function(t){t.preventDefault(),this.fire("service-selected",{domain:t.model.domain,service:t.model.service})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){var e=parseFloat(t);return!isNaN(e)&&isFinite(e)?e:null}Object.defineProperty(e,"__esModule",{value:!0});var o=n(219),a=r(o),u=n(1),s=r(u);e["default"]=new s["default"]({is:"state-history-chart-line",properties:{data:{type:Object,observer:"dataChanged"},unit:{type:String},isSingleDevice:{type:Boolean,value:!1},isAttached:{type:Boolean,value:!1,observer:"dataChanged"},chartEngine:{type:Object}},created:function(){this.style.display="block"},attached:function(){this.isAttached=!0},dataChanged:function(){this.drawChart()},drawChart:function(){if(this.isAttached){this.chartEngine||(this.chartEngine=new window.google.visualization.LineChart(this));var t=this.unit,e=this.data;if(0!==e.length){var n={legend:{position:"top"},interpolateNulls:!0,titlePosition:"none",vAxes:{0:{title:t}},hAxis:{format:"H:mm"},chartArea:{left:"60",width:"95%"},explorer:{actions:["dragToZoom","rightClickToReset","dragToPan"],keepInBounds:!0,axis:"horizontal",maxZoomIn:.1}};this.isSingleDevice&&(n.legend.position="none",n.vAxes[0].title=null,n.chartArea.left=40,n.chartArea.height="80%",n.chartArea.top=5,n.enableInteractivity=!1);var r=new Date(Math.min.apply(null,e.map(function(t){return t[0].lastChangedAsDate}))),o=new Date(r);o.setDate(o.getDate()+1),o>new Date&&(o=new Date);var u=e.map(function(t){function e(t,e){c&&e&&s.push([t[0]].concat(c.slice(1).map(function(t,n){return e[n]?t:null}))),s.push(t),c=t}var n=t[t.length-1],r=n.domain,a=n.entityDisplay,u=new window.google.visualization.DataTable;u.addColumn({type:"datetime",id:"Time"});var s=[],c=void 0;if("thermostat"===r){var l=t.reduce(function(t,e){return t||e.attributes.target_temp_high!==e.attributes.target_temp_low},!1);u.addColumn("number",a+" current temperature");var f=void 0;l?!function(){u.addColumn("number",a+" target temperature high"),u.addColumn("number",a+" target temperature low");var t=[!1,!0,!0];f=function(n){var r=i(n.attributes.current_temperature),o=i(n.attributes.target_temp_high),a=i(n.attributes.target_temp_low);e([n.lastUpdatedAsDate,r,o,a],t)}}():!function(){u.addColumn("number",a+" target temperature");var t=[!1,!0];f=function(n){var r=i(n.attributes.current_temperature),o=i(n.attributes.temperature);e([n.lastUpdatedAsDate,r,o],t)}}(),t.forEach(f)}else!function(){u.addColumn("number",a);var n="sensor"!==r&&[!0];t.forEach(function(t){var r=i(t.state);e([t.lastChangedAsDate,r],n)})}();return e([o].concat(c.slice(1)),!1),u.addRows(s),u}),s=void 0;s=1===u.length?u[0]:u.slice(1).reduce(function(t,e){return window.google.visualization.data.join(t,e,"full",[[0,0]],(0,a["default"])(1,t.getNumberOfColumns()),(0,a["default"])(1,e.getNumberOfColumns()))},u[0]),this.chartEngine.draw(s,n)}}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);e["default"]=new o["default"]({is:"state-history-chart-timeline",properties:{data:{type:Object,observer:"dataChanged"},isAttached:{type:Boolean,value:!1,observer:"dataChanged"}},attached:function(){this.isAttached=!0},dataChanged:function(){this.drawChart()},drawChart:function(){function t(t,e,n,r){var o=e.replace(/_/g," ");i.addRow([t,o,n,r])}if(this.isAttached){for(var e=o["default"].dom(this),n=this.data;e.node.lastChild;)e.node.removeChild(e.node.lastChild);if(n&&0!==n.length){var r=new window.google.visualization.Timeline(this),i=new window.google.visualization.DataTable;i.addColumn({type:"string",id:"Entity"}),i.addColumn({type:"string",id:"State"}),i.addColumn({type:"date",id:"Start"}),i.addColumn({type:"date",id:"End"});var a=new Date(n.reduce(function(t,e){return Math.min(t,e[0].lastChangedAsDate)},new Date)),u=new Date(a);u.setDate(u.getDate()+1),u>new Date&&(u=new Date);var s=0;n.forEach(function(e){if(0!==e.length){var n=e[0].entityDisplay,r=void 0,i=null,o=null;e.forEach(function(e){null!==i&&e.state!==i?(r=e.lastChangedAsDate,t(n,i,o,r),i=e.state,o=r):null===i&&(i=e.state,o=e.lastChangedAsDate)}),t(n,i,o,u),s++}}),r.draw(i,{height:55+42*s,timeline:{showRowLabels:n.length>1},hAxis:{format:"H:mm"}})}}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s),l=o["default"].streamGetters,f=o["default"].streamActions;e["default"]=new u["default"]({is:"stream-status",behaviors:[c["default"]],properties:{isStreaming:{type:Boolean,bindNuclear:l.isStreamingEvents},hasError:{type:Boolean,bindNuclear:l.hasStreamingEventsError}},toggleChanged:function(){this.isStreaming?f.stop():f.start()}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s),l=o["default"].voiceActions,f=o["default"].voiceGetters;e["default"]=new u["default"]({is:"ha-voice-command-dialog",behaviors:[c["default"]],properties:{dialogOpen:{type:Boolean,value:!1,observer:"dialogOpenChanged"},finalTranscript:{type:String,bindNuclear:f.finalTranscript},interimTranscript:{type:String,bindNuclear:f.extraInterimTranscript},isTransmitting:{type:Boolean,bindNuclear:f.isTransmitting},isListening:{type:Boolean,bindNuclear:f.isListening},showListenInterface:{type:Boolean,computed:"computeShowListenInterface(isListening, isTransmitting)",observer:"showListenInterfaceChanged"}},computeShowListenInterface:function(t,e){return t||e},dialogOpenChanged:function(t){!t&&this.isListening&&l.stop()},showListenInterfaceChanged:function(t){!t&&this.dialogOpen?this.dialogOpen=!1:t&&(this.dialogOpen=!0)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(32),n(58),n(181);var l=o["default"].configGetters,f=o["default"].entityHistoryGetters,d=o["default"].entityHistoryActions,h=o["default"].moreInfoGetters,p=o["default"].moreInfoActions,_=["camera","configurator","scene"];e["default"]=new u["default"]({is:"more-info-dialog",behaviors:[c["default"]],properties:{stateObj:{type:Object,bindNuclear:h.currentEntity,observer:"stateObjChanged"},stateHistory:{type:Object,bindNuclear:[h.currentEntityHistory,function(t){return t?[t]:!1}]},isLoadingHistoryData:{type:Boolean,computed:"computeIsLoadingHistoryData(_delayedDialogOpen, _isLoadingHistoryData)"},_isLoadingHistoryData:{type:Boolean,bindNuclear:f.isLoadingEntityHistory},hasHistoryComponent:{type:Boolean,bindNuclear:l.isComponentLoaded("history"),observer:"fetchHistoryData"},shouldFetchHistory:{type:Boolean,bindNuclear:h.isCurrentEntityHistoryStale,observer:"fetchHistoryData"},showHistoryComponent:{type:Boolean,value:!1,computed:"computeShowHistoryComponent(hasHistoryComponent, stateObj)"},dialogOpen:{type:Boolean,value:!1,observer:"dialogOpenChanged"},_delayedDialogOpen:{type:Boolean,value:!1}},computeIsLoadingHistoryData:function(t,e){return!t||e},computeShowHistoryComponent:function(t,e){return this.hasHistoryComponent&&e&&-1===_.indexOf(e.domain)},fetchHistoryData:function(){this.stateObj&&this.hasHistoryComponent&&this.shouldFetchHistory&&d.fetchRecent(this.stateObj.entityId)},stateObjChanged:function(t){var e=this;return t?void this.async(function(){e.fetchHistoryData(),e.dialogOpen=!0},10):void(this.dialogOpen=!1)},dialogOpenChanged:function(t){var e=this;t?this.async(function(){e._delayedDialogOpen=!0},10):!t&&this.stateObj&&(this.async(function(){return p.deselectEntity()},10),this._delayedDialogOpen=!1)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a),s=n(4),c=r(s),l=n(62),f=r(l);n(158),n(168),n(175),n(174),n(176),n(169),n(170),n(172),n(173),n(171),n(177),n(165),n(164);var d=u["default"].navigationActions,h=u["default"].navigationGetters,p=u["default"].startUrlSync,_=u["default"].stopUrlSync;e["default"]=new o["default"]({is:"home-assistant-main",behaviors:[c["default"]],properties:{narrow:{type:Boolean,value:!1},activePane:{type:String,bindNuclear:h.activePane,observer:"activePaneChanged"},isSelectedStates:{type:Boolean,bindNuclear:h.isActivePane("states")},isSelectedHistory:{type:Boolean,bindNuclear:h.isActivePane("history")},isSelectedMap:{type:Boolean,bindNuclear:h.isActivePane("map")},isSelectedLogbook:{type:Boolean,bindNuclear:h.isActivePane("logbook")},isSelectedDevEvent:{type:Boolean,bindNuclear:h.isActivePane("devEvent")},isSelectedDevState:{type:Boolean,bindNuclear:h.isActivePane("devState")},isSelectedDevTemplate:{type:Boolean,bindNuclear:h.isActivePane("devTemplate")},isSelectedDevService:{type:Boolean,bindNuclear:h.isActivePane("devService")},isSelectedDevInfo:{type:Boolean,bindNuclear:h.isActivePane("devInfo")},showSidebar:{type:Boolean,bindNuclear:h.showSidebar}},listeners:{"open-menu":"openMenu","close-menu":"closeMenu"},openMenu:function(){this.narrow?this.$.drawer.openDrawer():d.showSidebar(!0)},closeMenu:function(){this.$.drawer.closeDrawer(),this.showSidebar&&d.showSidebar(!1)},activePaneChanged:function(){this.narrow&&this.$.drawer.closeDrawer()},attached:function(){(0,f["default"])(),p()},computeForceNarrow:function(t,e){return t||!e},detached:function(){_()}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a),s=n(4),c=r(s),l=n(64),f=r(l),d=n(62),h=r(d),p=u["default"].authGetters;e["default"]=new o["default"]({is:"login-form",behaviors:[c["default"]],properties:{errorMessage:{type:String,bindNuclear:p.attemptErrorMessage},isInvalid:{type:Boolean,bindNuclear:p.isInvalidAttempt},isValidating:{type:Boolean,observer:"isValidatingChanged",bindNuclear:p.isValidating},loadingResources:{type:Boolean,value:!1},forceShowLoading:{type:Boolean,value:!1},showLoading:{type:Boolean,computed:"computeShowSpinner(forceShowLoading, isValidating)"}},listeners:{keydown:"passwordKeyDown","loginButton.tap":"validatePassword"},observers:["validatingChanged(isValidating, isInvalid)"],attached:function(){(0,h["default"])()},computeShowSpinner:function(t,e){return t||e},validatingChanged:function(t,e){t||e||(this.$.passwordInput.value="")},isValidatingChanged:function(t){var e=this;t||this.async(function(){return e.$.passwordInput.focus()},10)},passwordKeyDown:function(t){13===t.keyCode?(this.validatePassword(),t.preventDefault()):this.isInvalid&&(this.isInvalid=!1)},validatePassword:function(){this.$.hideKeyboardOnFocus.focus(),(0,f["default"])(this.$.passwordInput.value,this.$.rememberLogin.checked)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(9),n(154);var l=o["default"].configGetters,f=o["default"].viewActions,d=o["default"].viewGetters,h=o["default"].voiceGetters,p=o["default"].streamGetters,_=o["default"].syncGetters,v=o["default"].syncActions,y=o["default"].voiceActions;e["default"]=new u["default"]({is:"partial-cards",behaviors:[c["default"]],properties:{narrow:{type:Boolean,value:!1},isFetching:{type:Boolean,bindNuclear:_.isFetching},isStreaming:{type:Boolean,bindNuclear:p.isStreamingEvents},canListen:{ +e.extraInterimTranscript=[n,r,function(t,e){return t.slice(e.length)}]},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}function o(t){t.registerStores({currentVoiceCommand:c["default"],isVoiceSupported:u["default"]})}Object.defineProperty(e,"__esModule",{value:!0}),e.getters=e.actions=void 0,e.register=o;var a=n(135),u=i(a),s=n(134),c=i(s),l=n(131),f=r(l),d=n(132),h=r(d);e.actions=f,e.getters=h},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){return t.set("isListening",!0)}function o(t,e){var n=e.interimTranscript,r=e.finalTranscript;return t.withMutations(function(t){return t.set("isListening",!0).set("isTransmitting",!1).set("interimTranscript",n).set("finalTranscript",r)})}function a(t,e){var n=e.finalTranscript;return t.withMutations(function(t){return t.set("isListening",!1).set("isTransmitting",!0).set("interimTranscript","").set("finalTranscript",n)})}function u(){return h.getInitialState()}function s(){return h.getInitialState()}function c(){return h.getInitialState()}Object.defineProperty(e,"__esModule",{value:!0});var l=n(3),f=n(53),d=r(f),h=new l.Store({getInitialState:function(){return(0,l.toImmutable)({isListening:!1,isTransmitting:!1,interimTranscript:"",finalTranscript:""})},initialize:function(){this.on(d["default"].VOICE_START,i),this.on(d["default"].VOICE_RESULT,o),this.on(d["default"].VOICE_TRANSMITTING,a),this.on(d["default"].VOICE_DONE,u),this.on(d["default"].VOICE_ERROR,s),this.on(d["default"].LOG_OUT,c)}});e["default"]=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(3),i=new r.Store({getInitialState:function(){return"webkitSpeechRecognition"in window}});e["default"]=i},function(t,e,n){"use strict";function r(){var t=new i.Reactor({debug:!1});return t.hassId=o++,t}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=r;var i=n(3),o=0},function(t,e,n){"use strict";function r(t,e){return(0,i.toImmutable)(t.attributes.entity_id.map(function(t){return e.get(t)}).filter(function(t){return!!t}))}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=r;var i=n(3)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e,n){Object.keys(n).forEach(function(r){var i=n[r];"register"in i&&i.register(e),"getters"in i&&Object.defineProperty(t,r+"Getters",{value:i.getters,enumerable:!0}),"actions"in i&&!function(){var n={};Object.getOwnPropertyNames(i.actions).forEach(function(t){(0,a["default"])(i.actions[t])&&Object.defineProperty(n,t,{value:i.actions[t].bind(null,e),enumerable:!0})}),Object.defineProperty(t,r+"Actions",{value:n,enumerable:!0})}()})}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var o=n(37),a=r(o)},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]={UNIT_TEMP_C:"°C",UNIT_TEMP_F:"°F"}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(27),o=r(i),a=n(137),u=r(a),s=n(54),c=r(s),l=n(28),f=r(l),d=n(139),h=r(d);e["default"]={dateToStr:o["default"],expandGroup:u["default"],isStaleTime:c["default"],parseDateTime:f["default"],temperatureUnits:h["default"]}},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(151),e["default"]=new o["default"]({is:"ha-badges-card",properties:{states:{type:Array}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a),s=u["default"].moreInfoActions,c=1e4;e["default"]=new o["default"]({is:"ha-camera-card",properties:{stateObj:{type:Object,observer:"updateCameraFeedSrc"},cameraFeedSrc:{type:String},imageLoaded:{type:Boolean,value:!0},elevation:{type:Number,value:1,reflectToAttribute:!0}},listeners:{tap:"cardTapped"},attached:function(){var t=this;this.timer=setInterval(function(){return t.updateCameraFeedSrc(t.stateObj)},c)},detached:function(){clearInterval(this.timer)},cardTapped:function(){var t=this;this.async(function(){return s.selectEntity(t.stateObj.entityId)},1)},updateCameraFeedSrc:function(t){var e=(new Date).getTime();this.cameraFeedSrc=t.attributes.entity_picture+"?time="+e},imageLoadSuccess:function(){this.imageLoaded=!0},imageLoadFail:function(){this.imageLoaded=!1}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(36),u=r(a);n(142),n(144),n(145),n(146),e["default"]=new o["default"]({is:"ha-card-chooser",properties:{cardData:{type:Object,observer:"cardDataChanged"}},cardDataChanged:function(t){t&&(0,u["default"])(this,"HA-"+t.cardType.toUpperCase()+"-CARD",t)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a),s=n(34),c=r(s);n(56),n(29),n(32);var l=u["default"].moreInfoActions;e["default"]=new o["default"]({is:"ha-entities-card",properties:{states:{type:Array},groupEntity:{type:Object}},computeTitle:function(t,e){return e?e.entityDisplay:t[0].domain.replace(/_/g," ")},entityTapped:function(t){if(!t.target.classList.contains("paper-toggle-button")&&!t.target.classList.contains("paper-icon-button")){t.stopPropagation();var e=t.model.item.entityId;this.async(function(){return l.selectEntity(e)},1)}},showGroupToggle:function(t,e){return!t||!e||"on"!==t.state&&"off"!==t.state?!1:e.reduce(function(t,e){return t+(0,c["default"])(e.entityId)},0)>1}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(56),e["default"]=new o["default"]({is:"ha-introduction-card",properties:{showInstallInstruction:{type:Boolean,value:!1},showHideInstruction:{type:Boolean,value:!0}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a),s=u["default"].moreInfoActions;e["default"]=new o["default"]({is:"ha-media_player-card",properties:{stateObj:{type:Object},playerObj:{type:Object,computed:"computePlayerObj(stateObj)",observer:"playerObjChanged"},imageLoaded:{type:Boolean,value:!0},playbackControlIcon:{type:String,computed:"computePlaybackControlIcon(playerObj)"},elevation:{type:Number,value:1,reflectToAttribute:!0}},playerObjChanged:function(t){this.style.height=this.computeShowControls(t)?"175px":"78px",this.style.backgroundImage=t.stateObj.attributes.entity_picture?"url("+t.stateObj.attributes.entity_picture+")":""},imageLoadSuccess:function(){this.imageLoaded=!0},imageLoadFail:function(){this.imageLoaded=!1},computeHidePowerOnButton:function(t){return!t.isOff||!t.supportsTurnOn},computePlayerObj:function(t){return t.domainModel(u["default"])},computePlaybackControlIcon:function(t){return t.isPlaying?t.supportsPause?"mdi:pause":"mdi:stop":t.isPaused?"mdi:play":""},computeShowControls:function(t){return!t.isOff},computeVolumeMuteIcon:function(t){return t.isMuted?"mdi:volume-off":"mdi:volume-high"},handleNext:function(t){t.stopPropagation(),this.playerObj.nextTrack()},handleOpenMoreInfo:function(t){var e=this;t.stopPropagation(),this.async(function(){return s.selectEntity(e.stateObj.entityId)},1)},handlePlaybackControl:function(t){t.stopPropagation(),this.playerObj.mediaPlayPause()},handlePrevious:function(t){t.stopPropagation(),this.playerObj.previousTrack()},handlePowerOff:function(t){t.stopPropagation(),this.playerObj.turnOff()},handlePowerOn:function(t){t.stopPropagation(),this.playerObj.turnOn()},handleVolumeMute:function(t){t.stopPropagation(),this.playerObj.volumeMute(!this.playerObj.isMuted)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(61),u=r(a);e["default"]=new o["default"]({is:"display-time",properties:{dateObj:{type:Object}},computeTime:function(t){return t?(0,u["default"])(t):""}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s),l=o["default"].entityGetters;e["default"]=new u["default"]({is:"entity-list",behaviors:[c["default"]],properties:{entities:{type:Array,bindNuclear:[l.entityMap,function(t){return t.valueSeq().sortBy(function(t){return t.entityId}).toArray()}]}},entitySelected:function(t){t.preventDefault(),this.fire("entity-selected",{entityId:t.model.entity.entityId})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a);n(30);var s=u["default"].reactor,c=u["default"].entityGetters,l=u["default"].moreInfoActions;e["default"]=new o["default"]({is:"ha-entity-marker",properties:{entityId:{type:String,value:""},state:{type:Object,computed:"computeState(entityId)"},icon:{type:Object,computed:"computeIcon(state)"},image:{type:Object,computed:"computeImage(state)"},value:{type:String,computed:"computeValue(state)"}},listeners:{tap:"badgeTap"},badgeTap:function(t){var e=this;t.stopPropagation(),this.entityId&&this.async(function(){return l.selectEntity(e.entityId)},1)},computeState:function(t){return t&&s.evaluate(c.byId(t))},computeIcon:function(t){return!t&&"home"},computeImage:function(t){return t&&t.attributes.entity_picture},computeValue:function(t){return t&&t.entityDisplay.split(" ").map(function(t){return t.substr(0,1)}).join("")}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(63),u=r(a);e["default"]=new o["default"]({is:"ha-state-icon",properties:{stateObj:{type:Object}},computeIcon:function(t){return(0,u["default"])(t)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a),s=n(35),c=r(s),l=n(34),f=r(l),d=n(63),h=r(d);n(30);var p=u["default"].moreInfoActions,_=u["default"].serviceActions;e["default"]=new o["default"]({is:"ha-state-label-badge",properties:{state:{type:Object,observer:"stateChanged"}},listeners:{tap:"badgeTap"},badgeTap:function(t){var e=this;return t.stopPropagation(),(0,f["default"])(this.state.entityId)?void("scene"===this.state.domain||"off"===this.state.state?_.callTurnOn(this.state.entityId):_.callTurnOff(this.state.entityId)):void this.async(function(){return p.selectEntity(e.state.entityId)},1)},computeClasses:function(t){switch(t.domain){case"scene":return"green";case"binary_sensor":case"script":return"on"===t.state?"blue":"grey";case"updater":return"blue";default:return""}},computeValue:function(t){switch(t.domain){case"binary_sensor":case"device_tracker":case"updater":case"sun":case"scene":case"script":case"alarm_control_panel":return null;case"sensor":default:return"unknown"===t.state?"-":t.state}},computeIcon:function(t){switch(t.domain){case"alarm_control_panel":return"pending"===t.state?"mdi:clock-fast":"armed_away"===t.state?"mdi:nature":"armed_home"===t.state?"mdi:home-variant":(0,c["default"])(t.domain,t.state);case"binary_sensor":case"device_tracker":case"scene":case"updater":case"script":return(0,h["default"])(t);case"sun":return"above_horizon"===t.state?(0,c["default"])(t.domain):"mdi:brightness-3";default:return null}},computeImage:function(t){return t.attributes.entity_picture||null},computeLabel:function(t){switch(t.domain){case"scene":case"script":return t.domain;case"device_tracker":return"not_home"===t.state?"Away":t.state;case"alarm_control_panel":return"pending"===t.state?"pend":"armed_away"===t.state||"armed_home"===t.state?"armed":"disarm";default:return t.attributes.unit_of_measurement||null}},computeDescription:function(t){return t.entityDisplay},stateChanged:function(){this.updateStyles()}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(150),e["default"]=new o["default"]({is:"state-badge",properties:{stateObj:{type:Object,observer:"updateIconColor"}},updateIconColor:function(t){return t.attributes.entity_picture?(this.style.backgroundImage="url("+t.attributes.entity_picture+")",void(this.$.icon.style.display="none")):(this.style.backgroundImage="",this.$.icon.style.display="inline",void("light"===t.domain&&"on"===t.state&&t.attributes.rgb_color&&t.attributes.rgb_color.reduce(function(t,e){return t+e},0)<730?this.$.icon.style.color="rgb("+t.attributes.rgb_color.join(",")+")":this.$.icon.style.color=null))}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s),l=o["default"].eventGetters;e["default"]=new u["default"]({is:"events-list",behaviors:[c["default"]],properties:{events:{type:Array,bindNuclear:[l.entityMap,function(t){return t.valueSeq().sortBy(function(t){return t.event}).toArray()}]}},eventSelected:function(t){t.preventDefault(),this.fire("event-selected",{eventType:t.model.event.event})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){return t in d?d[t]:30}function o(t){return"group"===t.domain?t.attributes.order:t.entityDisplay.toLowerCase()}Object.defineProperty(e,"__esModule",{value:!0});var a=n(1),u=r(a),s=n(2),c=r(s);n(156),n(141),n(143);var l=c["default"].util,f=["camera","media_player"],d={configurator:-20,group:-10,a:-1,updater:0,sun:1,device_tracker:2,alarm_control_panel:3,sensor:5,binary_sensor:6,scene:7,script:8};e["default"]=new u["default"]({is:"ha-cards",properties:{showIntroduction:{type:Boolean,value:!1},columns:{type:Number,value:2},states:{type:Object},cards:{type:Object}},observers:["updateCards(columns, states, showIntroduction)"],updateCards:function(t,e,n){var r=this;this.debounce("updateCards",function(){r.cards=r.computeCards(t,e,n)},0)},computeCards:function(t,e,n){function r(t){return t.filter(function(t){return!(t.entityId in c)})}function a(){var e=p;return p=(p+1)%t,e}function u(t,e){var n=arguments.length<=2||void 0===arguments[2]?!1:arguments[2];if(0!==e.length){var r=[],i=[];e.forEach(function(t){-1===f.indexOf(t.domain)?i.push(t):r.push(t)});var o=a();i.length>0&&(d._columns[o].push(t),d[t]={cardType:"entities",states:i,groupEntity:n}),r.forEach(function(t){d._columns[o].push(t.entityId),d[t.entityId]={cardType:t.domain,stateObj:t}})}}for(var s=e.groupBy(function(t){return t.domain}),c={},d={_demo:!1,_badges:[],_columns:[]},h=0;t>h;h++)d._columns[h]=[];var p=0;return n&&(d._columns[a()].push("ha-introduction"),d["ha-introduction"]={cardType:"introduction",showHideInstruction:e.size>0&&!0}),s.keySeq().sortBy(function(t){return i(t)}).forEach(function(t){if("a"===t)return void(d._demo=!0);var n=i(t);n>=0&&10>n?d._badges.push.apply(d._badges,r(s.get(t)).sortBy(o).toArray()):"group"===t?s.get(t).sortBy(o).forEach(function(t){var n=l.expandGroup(t,e);n.forEach(function(t){c[t.entityId]=!0}),u(t.entityId,n.toArray(),t)}):u(t,r(s.get(t)).sortBy(o).toArray())}),d},computeCardDataOfCard:function(t,e){return t[e]}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);e["default"]=new o["default"]({is:"ha-color-picker",properties:{color:{type:Object},width:{type:Number},height:{type:Number}},listeners:{mousedown:"onMouseDown",mouseup:"onMouseUp",touchstart:"onTouchStart",touchend:"onTouchEnd"},onMouseDown:function(t){this.onMouseMove(t),this.addEventListener("mousemove",this.onMouseMove)},onMouseUp:function(){this.removeEventListener("mousemove",this.onMouseMove)},onTouchStart:function(t){this.onTouchMove(t),this.addEventListener("touchmove",this.onTouchMove)},onTouchEnd:function(){this.removeEventListener("touchmove",this.onTouchMove)},onTouchMove:function(t){var e=this;this.mouseMoveIsThrottled&&(this.mouseMoveIsThrottled=!1,this.processColorSelect(t.touches[0]),this.async(function(){e.mouseMoveIsThrottled=!0},100))},onMouseMove:function(t){var e=this;this.mouseMoveIsThrottled&&(this.mouseMoveIsThrottled=!1,this.processColorSelect(t),this.async(function(){e.mouseMoveIsThrottled=!0},100))},processColorSelect:function(t){var e=this.canvas.getBoundingClientRect();t.clientX=e.left+e.width||t.clientY=e.top+e.height||this.onColorSelect(t.clientX-e.left,t.clientY-e.top)},onColorSelect:function(t,e){var n=this.context.getImageData(t,e,1,1).data;this.setColor({r:n[0],g:n[1],b:n[2]})},setColor:function(t){this.color=t,this.fire("colorselected",{rgb:this.color})},ready:function(){this.setColor=this.setColor.bind(this),this.mouseMoveIsThrottled=!0,this.canvas=this.children[0],this.context=this.canvas.getContext("2d"),this.drawGradient()},drawGradient:function(){var t=void 0;this.width&&this.height||(t=getComputedStyle(this));var e=this.width||parseInt(t.width,10),n=this.height||parseInt(t.height,10),r=this.context.createLinearGradient(0,0,e,0);r.addColorStop(0,"rgb(255,0,0)"),r.addColorStop(.16,"rgb(255,0,255)"),r.addColorStop(.32,"rgb(0,0,255)"),r.addColorStop(.48,"rgb(0,255,255)"),r.addColorStop(.64,"rgb(0,255,0)"),r.addColorStop(.8,"rgb(255,255,0)"),r.addColorStop(1,"rgb(255,0,0)"),this.context.fillStyle=r,this.context.fillRect(0,0,e,n);var i=this.context.createLinearGradient(0,0,0,n);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(.5,"rgba(255,255,255,0)"),i.addColorStop(.5,"rgba(0,0,0,0)"),i.addColorStop(1,"rgba(0,0,0,1)"),this.context.fillStyle=i,this.context.fillRect(0,0,e,n)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(30),e["default"]=new o["default"]({is:"ha-demo-badge"})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(159),e["default"]=new o["default"]({is:"ha-logbook",properties:{entries:{type:Object,value:[]}},noEntries:function(t){return!t.length}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(163);var l=o["default"].configGetters,f=o["default"].navigationGetters,d=o["default"].authActions,h=o["default"].navigationActions;e["default"]=new u["default"]({is:"ha-sidebar",behaviors:[c["default"]],properties:{menuShown:{type:Boolean},menuSelected:{type:String},narrow:{type:Boolean},selected:{type:String,bindNuclear:f.activePane},hasHistoryComponent:{type:Boolean,bindNuclear:l.isComponentLoaded("history")},hasLogbookComponent:{type:Boolean,bindNuclear:l.isComponentLoaded("logbook")}},menuSelect:function(){var t=this;this.debounce("updateStyles",function(){return t.updateStyles()},1)},menuClicked:function(t){for(var e=t.target,n=5;n&&!e.getAttribute("data-panel");)e=e.parentElement,n--;n&&this.selectPanel(e.getAttribute("data-panel"))},toggleMenu:function(){this.fire("close-menu")},selectPanel:function(t){var e=this;if(t!==this.selected){if("logout"===t)return void this.handleLogOut();h.navigate.apply(null,t.split("/")),this.debounce("updateStyles",function(){return e.updateStyles()},1)}},handleLogOut:function(){d.logOut()}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a);n(55),n(147),n(57);var s=o["default"].moreInfoActions;e["default"]=new u["default"]({is:"logbook-entry",entityClicked:function(t){t.preventDefault(),s.selectEntity(this.entryObj.entityId)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(55);var l=o["default"].serviceGetters;e["default"]=new u["default"]({is:"services-list",behaviors:[c["default"]],properties:{serviceDomains:{type:Array,bindNuclear:l.entityMap}},computeDomains:function(t){return t.valueSeq().map(function(t){return t.domain}).sort().toJS()},computeServices:function(t,e){return t.get(e).get("services").keySeq().toArray()},serviceClicked:function(t){t.preventDefault(),this.fire("service-selected",{domain:t.model.domain,service:t.model.service})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){var e=parseFloat(t);return!isNaN(e)&&isFinite(e)?e:null}Object.defineProperty(e,"__esModule",{value:!0});var o=n(219),a=r(o),u=n(1),s=r(u);e["default"]=new s["default"]({is:"state-history-chart-line",properties:{data:{type:Object,observer:"dataChanged"},unit:{type:String},isSingleDevice:{type:Boolean,value:!1},isAttached:{type:Boolean,value:!1,observer:"dataChanged"},chartEngine:{type:Object}},created:function(){this.style.display="block"},attached:function(){this.isAttached=!0},dataChanged:function(){this.drawChart()},drawChart:function(){if(this.isAttached){this.chartEngine||(this.chartEngine=new window.google.visualization.LineChart(this));var t=this.unit,e=this.data;if(0!==e.length){var n={legend:{position:"top"},interpolateNulls:!0,titlePosition:"none",vAxes:{0:{title:t}},hAxis:{format:"H:mm"},chartArea:{left:"60",width:"95%"},explorer:{actions:["dragToZoom","rightClickToReset","dragToPan"],keepInBounds:!0,axis:"horizontal",maxZoomIn:.1}};this.isSingleDevice&&(n.legend.position="none",n.vAxes[0].title=null,n.chartArea.left=40,n.chartArea.height="80%",n.chartArea.top=5,n.enableInteractivity=!1);var r=new Date(Math.min.apply(null,e.map(function(t){return t[0].lastChangedAsDate}))),o=new Date(r);o.setDate(o.getDate()+1),o>new Date&&(o=new Date);var u=e.map(function(t){function e(t,e){c&&e&&s.push([t[0]].concat(c.slice(1).map(function(t,n){return e[n]?t:null}))),s.push(t),c=t}var n=t[t.length-1],r=n.domain,a=n.entityDisplay,u=new window.google.visualization.DataTable;u.addColumn({type:"datetime",id:"Time"});var s=[],c=void 0;if("thermostat"===r){var l=t.reduce(function(t,e){return t||e.attributes.target_temp_high!==e.attributes.target_temp_low},!1);u.addColumn("number",a+" current temperature");var f=void 0;l?!function(){u.addColumn("number",a+" target temperature high"),u.addColumn("number",a+" target temperature low");var t=[!1,!0,!0];f=function(n){var r=i(n.attributes.current_temperature),o=i(n.attributes.target_temp_high),a=i(n.attributes.target_temp_low);e([n.lastUpdatedAsDate,r,o,a],t)}}():!function(){u.addColumn("number",a+" target temperature");var t=[!1,!0];f=function(n){var r=i(n.attributes.current_temperature),o=i(n.attributes.temperature);e([n.lastUpdatedAsDate,r,o],t)}}(),t.forEach(f)}else!function(){u.addColumn("number",a);var n="sensor"!==r&&[!0];t.forEach(function(t){var r=i(t.state);e([t.lastChangedAsDate,r],n)})}();return e([o].concat(c.slice(1)),!1),u.addRows(s),u}),s=void 0;s=1===u.length?u[0]:u.slice(1).reduce(function(t,e){return window.google.visualization.data.join(t,e,"full",[[0,0]],(0,a["default"])(1,t.getNumberOfColumns()),(0,a["default"])(1,e.getNumberOfColumns()))},u[0]),this.chartEngine.draw(s,n)}}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);e["default"]=new o["default"]({is:"state-history-chart-timeline",properties:{data:{type:Object,observer:"dataChanged"},isAttached:{type:Boolean,value:!1,observer:"dataChanged"}},attached:function(){this.isAttached=!0},dataChanged:function(){this.drawChart()},drawChart:function(){function t(t,e,n,r){var o=e.replace(/_/g," ");i.addRow([t,o,n,r])}if(this.isAttached){for(var e=o["default"].dom(this),n=this.data;e.node.lastChild;)e.node.removeChild(e.node.lastChild);if(n&&0!==n.length){var r=new window.google.visualization.Timeline(this),i=new window.google.visualization.DataTable;i.addColumn({type:"string",id:"Entity"}),i.addColumn({type:"string",id:"State"}),i.addColumn({type:"date",id:"Start"}),i.addColumn({type:"date",id:"End"});var a=new Date(n.reduce(function(t,e){return Math.min(t,e[0].lastChangedAsDate)},new Date)),u=new Date(a);u.setDate(u.getDate()+1),u>new Date&&(u=new Date);var s=0;n.forEach(function(e){if(0!==e.length){var n=e[0].entityDisplay,r=void 0,i=null,o=null;e.forEach(function(e){null!==i&&e.state!==i?(r=e.lastChangedAsDate,t(n,i,o,r),i=e.state,o=r):null===i&&(i=e.state,o=e.lastChangedAsDate)}),t(n,i,o,u),s++}}),r.draw(i,{height:55+42*s,timeline:{showRowLabels:n.length>1},hAxis:{format:"H:mm"}})}}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s),l=o["default"].streamGetters,f=o["default"].streamActions;e["default"]=new u["default"]({is:"stream-status",behaviors:[c["default"]],properties:{isStreaming:{type:Boolean,bindNuclear:l.isStreamingEvents},hasError:{type:Boolean,bindNuclear:l.hasStreamingEventsError}},toggleChanged:function(){this.isStreaming?f.stop():f.start()}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s),l=o["default"].voiceActions,f=o["default"].voiceGetters;e["default"]=new u["default"]({is:"ha-voice-command-dialog",behaviors:[c["default"]],properties:{dialogOpen:{type:Boolean,value:!1,observer:"dialogOpenChanged"},finalTranscript:{type:String,bindNuclear:f.finalTranscript},interimTranscript:{type:String,bindNuclear:f.extraInterimTranscript},isTransmitting:{type:Boolean,bindNuclear:f.isTransmitting},isListening:{type:Boolean,bindNuclear:f.isListening},showListenInterface:{type:Boolean,computed:"computeShowListenInterface(isListening, isTransmitting)",observer:"showListenInterfaceChanged"}},computeShowListenInterface:function(t,e){return t||e},dialogOpenChanged:function(t){!t&&this.isListening&&l.stop()},showListenInterfaceChanged:function(t){!t&&this.dialogOpen?this.dialogOpen=!1:t&&(this.dialogOpen=!0)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(32),n(58),n(181);var l=o["default"].configGetters,f=o["default"].entityHistoryGetters,d=o["default"].entityHistoryActions,h=o["default"].moreInfoGetters,p=o["default"].moreInfoActions,_=["camera","configurator","scene"];e["default"]=new u["default"]({is:"more-info-dialog",behaviors:[c["default"]],properties:{stateObj:{type:Object,bindNuclear:h.currentEntity,observer:"stateObjChanged"},stateHistory:{type:Object,bindNuclear:[h.currentEntityHistory,function(t){return t?[t]:!1}]},isLoadingHistoryData:{type:Boolean,computed:"computeIsLoadingHistoryData(_delayedDialogOpen, _isLoadingHistoryData)"},_isLoadingHistoryData:{type:Boolean,bindNuclear:f.isLoadingEntityHistory},hasHistoryComponent:{type:Boolean,bindNuclear:l.isComponentLoaded("history"),observer:"fetchHistoryData"},shouldFetchHistory:{type:Boolean,bindNuclear:h.isCurrentEntityHistoryStale,observer:"fetchHistoryData"},showHistoryComponent:{type:Boolean,value:!1,computed:"computeShowHistoryComponent(hasHistoryComponent, stateObj)"},dialogOpen:{type:Boolean,value:!1,observer:"dialogOpenChanged"},_delayedDialogOpen:{type:Boolean,value:!1}},computeIsLoadingHistoryData:function(t,e){return!t||e},computeShowHistoryComponent:function(t,e){return this.hasHistoryComponent&&e&&-1===_.indexOf(e.domain)},fetchHistoryData:function(){this.stateObj&&this.hasHistoryComponent&&this.shouldFetchHistory&&d.fetchRecent(this.stateObj.entityId)},stateObjChanged:function(t){var e=this;return t?void this.async(function(){e.fetchHistoryData(),e.dialogOpen=!0},10):void(this.dialogOpen=!1)},dialogOpenChanged:function(t){var e=this;t?this.async(function(){e._delayedDialogOpen=!0},10):!t&&this.stateObj&&(this.async(function(){return p.deselectEntity()},10),this._delayedDialogOpen=!1)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a),s=n(4),c=r(s),l=n(62),f=r(l);n(158),n(168),n(175),n(174),n(176),n(169),n(170),n(172),n(173),n(171),n(177),n(165),n(164);var d=u["default"].navigationActions,h=u["default"].navigationGetters,p=u["default"].startUrlSync,_=u["default"].stopUrlSync;e["default"]=new o["default"]({is:"home-assistant-main",behaviors:[c["default"]],properties:{narrow:{type:Boolean,value:!1},activePane:{type:String,bindNuclear:h.activePane,observer:"activePaneChanged"},isSelectedStates:{type:Boolean,bindNuclear:h.isActivePane("states")},isSelectedHistory:{type:Boolean,bindNuclear:h.isActivePane("history")},isSelectedMap:{type:Boolean,bindNuclear:h.isActivePane("map")},isSelectedLogbook:{type:Boolean,bindNuclear:h.isActivePane("logbook")},isSelectedDevEvent:{type:Boolean,bindNuclear:h.isActivePane("devEvent")},isSelectedDevState:{type:Boolean,bindNuclear:h.isActivePane("devState")},isSelectedDevTemplate:{type:Boolean,bindNuclear:h.isActivePane("devTemplate")},isSelectedDevService:{type:Boolean,bindNuclear:h.isActivePane("devService")},isSelectedDevInfo:{type:Boolean,bindNuclear:h.isActivePane("devInfo")},showSidebar:{type:Boolean,bindNuclear:h.showSidebar}},listeners:{"open-menu":"openMenu","close-menu":"closeMenu"},openMenu:function(){this.narrow?this.$.drawer.openDrawer():d.showSidebar(!0)},closeMenu:function(){this.$.drawer.closeDrawer(),this.showSidebar&&d.showSidebar(!1)},activePaneChanged:function(){this.narrow&&this.$.drawer.closeDrawer()},attached:function(){(0,f["default"])(),p()},computeForceNarrow:function(t,e){return t||!e},detached:function(){_()}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a),s=n(4),c=r(s),l=n(64),f=r(l),d=n(62),h=r(d),p=u["default"].authGetters;e["default"]=new o["default"]({is:"login-form",behaviors:[c["default"]],properties:{errorMessage:{type:String,bindNuclear:p.attemptErrorMessage},isInvalid:{type:Boolean,bindNuclear:p.isInvalidAttempt},isValidating:{type:Boolean,observer:"isValidatingChanged",bindNuclear:p.isValidating},loadingResources:{type:Boolean,value:!1},forceShowLoading:{type:Boolean,value:!1},showLoading:{type:Boolean,computed:"computeShowSpinner(forceShowLoading, isValidating)"}},listeners:{keydown:"passwordKeyDown","loginButton.tap":"validatePassword"},observers:["validatingChanged(isValidating, isInvalid)"],attached:function(){(0,h["default"])()},computeShowSpinner:function(t,e){return t||e},validatingChanged:function(t,e){t||e||(this.$.passwordInput.value="")},isValidatingChanged:function(t){var e=this;t||this.async(function(){return e.$.passwordInput.focus()},10)},passwordKeyDown:function(t){13===t.keyCode?(this.validatePassword(),t.preventDefault()):this.isInvalid&&(this.isInvalid=!1)},validatePassword:function(){this.$.hideKeyboardOnFocus.focus(),(0,f["default"])(this.$.passwordInput.value,this.$.rememberLogin.checked)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(9),n(154);var l=o["default"].configGetters,f=o["default"].viewActions,d=o["default"].viewGetters,h=o["default"].voiceGetters,p=o["default"].streamGetters,_=o["default"].syncGetters,v=o["default"].syncActions,y=o["default"].voiceActions;e["default"]=new u["default"]({is:"partial-cards",behaviors:[c["default"]],properties:{narrow:{type:Boolean,value:!1},isFetching:{type:Boolean,bindNuclear:_.isFetching},isStreaming:{type:Boolean,bindNuclear:p.isStreamingEvents},canListen:{ type:Boolean,bindNuclear:[h.isVoiceSupported,l.isComponentLoaded("conversation"),function(t,e){return t&&e}]},introductionLoaded:{type:Boolean,bindNuclear:l.isComponentLoaded("introduction")},locationName:{type:String,bindNuclear:l.locationName},showMenu:{type:Boolean,value:!1,observer:"windowChange"},currentView:{type:String,bindNuclear:[d.currentView,function(t){return t||""}],observer:"removeFocus"},views:{type:Array,bindNuclear:[d.views,function(t){return t.valueSeq().sortBy(function(t){return t.attributes.order}).toArray()}]},hasViews:{type:Boolean,computed:"computeHasViews(views)"},states:{type:Object,bindNuclear:d.currentViewEntities},columns:{type:Number,value:1}},created:function(){var t=this;this.windowChange=this.windowChange.bind(this);for(var e=[],n=0;5>n;n++)e.push(300+300*n);this.mqls=e.map(function(e){var n=window.matchMedia("(min-width: "+e+"px)");return n.addListener(t.windowChange),n})},detached:function(){var t=this;this.mqls.forEach(function(e){return e.removeListener(t.windowChange)})},windowChange:function(){var t=this.mqls.reduce(function(t,e){return t+e.matches},0);this.columns=Math.max(1,t-(!this.narrow&&this.showMenu))},removeFocus:function(){document.activeElement&&document.activeElement.blur()},handleRefresh:function(){v.fetchAll()},handleListenClick:function(){y.listen()},computeMenuButtonClass:function(t,e){return!t&&e?"invisible":""},computeRefreshButtonClass:function(t){return t?"ha-spin":""},computeShowIntroduction:function(t,e,n){return""===t&&(e||0===n.size)},computeHasViews:function(t){return t.length>0},toggleMenu:function(){this.fire("open-menu")},viewSelected:function(t){var e=t.detail.item.getAttribute("data-entity")||null,n=this.currentView||null;e!==n&&this.async(function(){return f.selectView(e)},0)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a);n(9),n(160);var s=o["default"].reactor,c=o["default"].serviceActions,l=o["default"].serviceGetters;e["default"]=new u["default"]({is:"partial-dev-call-service",properties:{narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,value:!1},domain:{type:String,value:""},service:{type:String,value:""},serviceData:{type:String,value:""},description:{type:String,computed:"computeDescription(domain, service)"}},computeDescription:function(t,e){return s.evaluate([l.entityMap,function(n){return n.has(t)&&n.get(t).get("services").has(e)?JSON.stringify(n.get(t).get("services").get(e).toJS(),null,2):"No description available"}])},serviceSelected:function(t){this.domain=t.detail.domain,this.service=t.detail.service},callService:function(){var t=void 0;try{t=this.serviceData?JSON.parse(this.serviceData):{}}catch(e){return void alert("Error parsing JSON: "+e)}c.callService(this.domain,this.service,t)},computeFormClasses:function(t){return"content fit "+(t?"":"layout horizontal")}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a);n(9),n(153);var s=o["default"].eventActions;e["default"]=new u["default"]({is:"partial-dev-fire-event",properties:{narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,value:!1},eventType:{type:String,value:""},eventData:{type:String,value:""}},eventSelected:function(t){this.eventType=t.detail.eventType},fireEvent:function(){var t=void 0;try{t=this.eventData?JSON.parse(this.eventData):{}}catch(e){return void alert("Error parsing JSON: "+e)}s.fireEvent(this.eventType,t)},computeFormClasses:function(t){return"content fit "+(t?"":"layout horizontal")}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(9);var l=o["default"].configGetters,f=o["default"].errorLogActions;e["default"]=new u["default"]({is:"partial-dev-info",behaviors:[c["default"]],properties:{narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,value:!1},hassVersion:{type:String,bindNuclear:l.serverVersion},polymerVersion:{type:String,value:u["default"].version},nuclearVersion:{type:String,value:"1.3.0"},errorLog:{type:String,value:""}},attached:function(){this.refreshErrorLog()},refreshErrorLog:function(t){var e=this;t&&t.preventDefault(),this.errorLog="Loading error log…",f.fetchErrorLog().then(function(t){e.errorLog=t||"No errors have been reported."})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a);n(9),n(148);var s=o["default"].reactor,c=o["default"].entityGetters,l=o["default"].entityActions;e["default"]=new u["default"]({is:"partial-dev-set-state",properties:{narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,value:!1},entityId:{type:String,value:""},state:{type:String,value:""},stateAttributes:{type:String,value:""}},setStateData:function(t){var e=t?JSON.stringify(t,null," "):"";this.$.inputData.value=e,this.$.inputDataWrapper.update(this.$.inputData)},entitySelected:function(t){var e=s.evaluate(c.byId(t.detail.entityId));this.entityId=e.entityId,this.state=e.state,this.stateAttributes=JSON.stringify(e.attributes,null," ")},handleSetState:function(){var t=void 0;try{t=this.stateAttributes?JSON.parse(this.stateAttributes):{}}catch(e){return void alert("Error parsing JSON: "+e)}l.save({entityId:this.entityId,state:this.state,attributes:t})},computeFormClasses:function(t){return"content fit "+(t?"":"layout horizontal")}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(9);var l=o["default"].templateActions;e["default"]=new u["default"]({is:"partial-dev-template",behaviors:[c["default"]],properties:{narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,value:!1},error:{type:Boolean,value:!1},rendering:{type:Boolean,value:!1},template:{type:String,value:'{%- if is_state("device_tracker.paulus", "home") and \n is_state("device_tracker.anne_therese", "home") -%}\n\n You are both home, you silly\n\n{%- else -%}\n\n Anne Therese is at {{ states("device_tracker.anne_therese") }} and Paulus is at {{ states("device_tracker.paulus") }}\n\n{%- endif %}\n\nFor loop example:\n\n{% for state in states.sensor -%}\n {%- if loop.first %}The {% elif loop.last %} and the {% else %}, the {% endif -%}\n {{ state.name | lower }} is {{state.state}} {{- state.attributes.unit_of_measurement}}\n{%- endfor -%}.',observer:"templateChanged"},processed:{type:String,value:""}},computeFormClasses:function(t){return"content fit "+(t?"":"layout horizontal")},computeRenderedClasses:function(t){return t?"error rendered":"rendered"},templateChanged:function(){this.error&&(this.error=!1),this.debounce("render-template",this.renderTemplate,500)},renderTemplate:function(){var t=this;this.rendering=!0,l.render(this.template).then(function(e){t.processed=e,t.rendering=!1},function(e){t.processed=e.message,t.error=!0,t.rendering=!1})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(9),n(58);var l=o["default"].entityHistoryGetters,f=o["default"].entityHistoryActions;e["default"]=new u["default"]({is:"partial-history",behaviors:[c["default"]],properties:{narrow:{type:Boolean},showMenu:{type:Boolean,value:!1},isDataLoaded:{type:Boolean,bindNuclear:l.hasDataForCurrentDate,observer:"isDataLoadedChanged"},stateHistory:{type:Object,bindNuclear:l.entityHistoryForCurrentDate},isLoadingData:{type:Boolean,bindNuclear:l.isLoadingEntityHistory},selectedDate:{type:String,value:null,bindNuclear:l.currentDate}},isDataLoadedChanged:function(t){t||this.async(function(){return f.fetchSelectedDate()},1)},handleRefreshClick:function(){f.fetchSelectedDate()},datepickerFocus:function(){this.datePicker.adjustPosition()},attached:function(){this.datePicker=new window.Pikaday({field:this.$.datePicker.inputElement,onSelect:f.changeCurrentDate})},detached:function(){this.datePicker.destroy()},computeContentClasses:function(t){return"flex content "+(t?"narrow":"wide")}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(9),n(157),n(31);var l=o["default"].logbookGetters,f=o["default"].logbookActions;e["default"]=new u["default"]({is:"partial-logbook",behaviors:[c["default"]],properties:{narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,value:!1},selectedDate:{type:String,bindNuclear:l.currentDate},isLoading:{type:Boolean,bindNuclear:l.isLoadingEntries},isStale:{type:Boolean,bindNuclear:l.isCurrentStale,observer:"isStaleChanged"},entries:{type:Array,bindNuclear:[l.currentEntries,function(t){return t.reverse().toArray()}]},datePicker:{type:Object}},isStaleChanged:function(t){var e=this;t&&this.async(function(){return f.fetchDate(e.selectedDate)},1)},handleRefresh:function(){f.fetchDate(this.selectedDate)},datepickerFocus:function(){this.datePicker.adjustPosition()},attached:function(){this.datePicker=new window.Pikaday({field:this.$.datePicker.inputElement,onSelect:f.changeCurrentDate})},detached:function(){this.datePicker.destroy()}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(149);var l=o["default"].configGetters,f=o["default"].entityGetters;window.L.Icon.Default.imagePath="/static/images/leaflet",e["default"]=new u["default"]({is:"partial-map",behaviors:[c["default"]],properties:{locationGPS:{type:Number,bindNuclear:l.locationGPS},locationName:{type:String,bindNuclear:l.locationName},locationEntities:{type:Array,bindNuclear:[f.visibleEntityMap,function(t){return t.valueSeq().filter(function(t){return t.attributes.latitude&&"home"!==t.state}).toArray()}]},zoneEntities:{type:Array,bindNuclear:[f.entityMap,function(t){return t.valueSeq().filter(function(t){return"zone"===t.domain&&!t.attributes.passive}).toArray()}]},narrow:{type:Boolean},showMenu:{type:Boolean,value:!1}},attached:function(){var t=this;(window.L.Browser.mobileWebkit||window.L.Browser.webkit)&&this.async(function(){var e=t.$.map,n=e.style.display;e.style.display="none",t.async(function(){e.style.display=n},1)},1)},computeMenuButtonClass:function(t,e){return!t&&e?"invisible":""},toggleMenu:function(){this.fire("open-menu")}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s),l=o["default"].notificationGetters;e["default"]=new u["default"]({is:"notification-manager",behaviors:[c["default"]],properties:{neg:{type:Boolean,value:!1},text:{type:String,bindNuclear:l.lastNotificationMessage,observer:"showNotification"}},showNotification:function(t){t&&this.$.toast.show()}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=o["default"].serviceActions;e["default"]=new u["default"]({is:"more-info-alarm_control_panel",handleDisarmTap:function(){this.callService("alarm_disarm",{code:this.enteredCode})},handleHomeTap:function(){this.callService("alarm_arm_home",{code:this.enteredCode})},handleAwayTap:function(){this.callService("alarm_arm_away",{code:this.enteredCode})},properties:{stateObj:{type:Object,observer:"stateObjChanged"},enteredCode:{type:String,value:""},disarmButtonVisible:{type:Boolean,value:!1},armHomeButtonVisible:{type:Boolean,value:!1},armAwayButtonVisible:{type:Boolean,value:!1},codeInputVisible:{type:Boolean,value:!1},codeInputEnabled:{type:Boolean,value:!1},codeFormat:{type:String,value:""},codeValid:{type:Boolean,computed:"validateCode(enteredCode, codeFormat)"}},validateCode:function(t,e){var n=new RegExp(e);return null===e?!0:n.test(t)},stateObjChanged:function(t){var e=this;t&&(this.codeFormat=t.attributes.code_format,this.codeInputVisible=null!==this.codeFormat,this.codeInputEnabled="armed_home"===t.state||"armed_away"===t.state||"disarmed"===t.state||"pending"===t.state||"triggered"===t.state,this.disarmButtonVisible="armed_home"===t.state||"armed_away"===t.state||"pending"===t.state||"triggered"===t.state,this.armHomeButtonVisible="disarmed"===t.state,this.armAwayButtonVisible="disarmed"===t.state),this.async(function(){return e.fire("iron-resize")},500)},callService:function(t,e){var n=e||{};n.entity_id=this.stateObj.entityId,s.callService("alarm_control_panel",t,n)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);e["default"]=new o["default"]({is:"more-info-camera",properties:{stateObj:{type:Object}},imageLoaded:function(){this.fire("iron-resize")},computeCameraImageUrl:function(t){return t?"/api/camera_proxy_stream/"+this.stateObj.entityId:"data:image/gif;base64,R0lGODlhAQABAAAAACw="}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(31);var l=o["default"].streamGetters,f=o["default"].syncActions,d=o["default"].serviceActions;e["default"]=new u["default"]({is:"more-info-configurator",behaviors:[c["default"]],properties:{stateObj:{type:Object},action:{type:String,value:"display"},isStreaming:{type:Boolean,bindNuclear:l.isStreamingEvents},isConfigurable:{type:Boolean,computed:"computeIsConfigurable(stateObj)"},isConfiguring:{type:Boolean,value:!1},submitCaption:{type:String,computed:"computeSubmitCaption(stateObj)"},fieldInput:{type:Object,value:{}}},computeIsConfigurable:function(t){return"configure"===t.state},computeSubmitCaption:function(t){return t.attributes.submit_caption||"Set configuration"},fieldChanged:function(t){var e=t.target;this.fieldInput[e.id]=e.value},submitClicked:function(){var t=this;this.isConfiguring=!0;var e={configure_id:this.stateObj.attributes.configure_id,fields:this.fieldInput};d.callService("configurator","configure",e).then(function(){t.isConfiguring=!1,t.isStreaming||f.fetchAll()},function(){t.isConfiguring=!1})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(36),u=r(a),s=n(204),c=r(s);n(182),n(183),n(188),n(180),n(189),n(187),n(184),n(186),n(179),n(190),n(178),n(185),e["default"]=new o["default"]({is:"more-info-content",properties:{stateObj:{type:Object,observer:"stateObjChanged"}},stateObjChanged:function(t){t&&(0,u["default"])(this,"MORE-INFO-"+(0,c["default"])(t).toUpperCase(),{stateObj:t})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=["entity_picture","friendly_name","icon","unit_of_measurement"];e["default"]=new o["default"]({is:"more-info-default",properties:{stateObj:{type:Object}},computeDisplayAttributes:function(t){return t?Object.keys(t.attributes).filter(function(t){return-1===a.indexOf(t)}):[]},getAttributeValue:function(t,e){var n=t.attributes[e];return Array.isArray(n)?n.join(", "):n}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(32);var l=o["default"].entityGetters,f=o["default"].moreInfoGetters;e["default"]=new u["default"]({is:"more-info-group",behaviors:[c["default"]],properties:{stateObj:{type:Object},states:{type:Array,bindNuclear:[f.currentEntity,l.entityMap,function(t,e){return t?t.attributes.entity_id.map(e.get.bind(e)):[]}]}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){f.callService("light","turn_on",{entity_id:t,rgb_color:[e.r,e.g,e.b]})}Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),a=r(o),u=n(1),s=r(u),c=n(33),l=r(c);n(155);var f=a["default"].serviceActions,d=["brightness","rgb_color","color_temp"];e["default"]=new s["default"]({is:"more-info-light",properties:{stateObj:{type:Object,observer:"stateObjChanged"},brightnessSliderValue:{type:Number,value:0},ctSliderValue:{type:Number,value:0}},stateObjChanged:function(t){var e=this;t&&"on"===t.state&&(this.brightnessSliderValue=t.attributes.brightness,this.ctSliderValue=t.attributes.color_temp),this.async(function(){return e.fire("iron-resize")},500)},computeClassNames:function(t){return(0,l["default"])(t,d)},brightnessSliderChanged:function(t){var e=parseInt(t.target.value,10);isNaN(e)||(0===e?f.callTurnOff(this.stateObj.entityId):f.callService("light","turn_on",{entity_id:this.stateObj.entityId,brightness:e}))},ctSliderChanged:function(t){var e=parseInt(t.target.value,10);isNaN(e)||f.callService("light","turn_on",{entity_id:this.stateObj.entityId,color_temp:e})},colorPicked:function(t){var e=this;return this.skipColorPicked?void(this.colorChanged=!0):(this.color=t.detail.rgb,i(this.stateObj.entityId,this.color),this.colorChanged=!1,this.skipColorPicked=!0,void(this.colorDebounce=setTimeout(function(){e.colorChanged&&i(e.stateObj.entityId,e.color),e.skipColorPicked=!1},500)))}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=o["default"].serviceActions;e["default"]=new u["default"]({is:"more-info-lock",properties:{stateObj:{type:Object,observer:"stateObjChanged"},enteredCode:{type:String,value:""}},handleUnlockTap:function(){this.callService("unlock",{code:this.enteredCode})},handleLockTap:function(){this.callService("lock",{code:this.enteredCode})},stateObjChanged:function(t){var e=this;t&&(this.isLocked="locked"===t.state),this.async(function(){return e.fire("iron-resize")},500)},callService:function(t,e){var n=e||{};n.entity_id=this.stateObj.entityId,s.callService("lock",t,n)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(33),c=r(s),l=o["default"].serviceActions,f=["volume_level"];e["default"]=new u["default"]({is:"more-info-media_player",properties:{stateObj:{type:Object,observer:"stateObjChanged"},isOff:{type:Boolean,value:!1},isPlaying:{type:Boolean,value:!1},isMuted:{type:Boolean,value:!1},volumeSliderValue:{type:Number,value:0},supportsPause:{type:Boolean,value:!1},supportsVolumeSet:{type:Boolean,value:!1},supportsVolumeMute:{type:Boolean,value:!1},supportsPreviousTrack:{type:Boolean,value:!1},supportsNextTrack:{type:Boolean,value:!1},supportsTurnOn:{type:Boolean,value:!1},supportsTurnOff:{type:Boolean,value:!1},supportsVolumeButtons:{type:Boolean,value:!1},hasMediaControl:{type:Boolean,value:!1}},stateObjChanged:function(t){var e=this;if(t){var n=["playing","paused","unknown"];this.isOff="off"===t.state,this.isPlaying="playing"===t.state,this.hasMediaControl=-1!==n.indexOf(t.state),this.volumeSliderValue=100*t.attributes.volume_level,this.isMuted=t.attributes.is_volume_muted,this.supportsPause=0!==(1&t.attributes.supported_media_commands),this.supportsVolumeSet=0!==(4&t.attributes.supported_media_commands),this.supportsVolumeMute=0!==(8&t.attributes.supported_media_commands),this.supportsPreviousTrack=0!==(16&t.attributes.supported_media_commands),this.supportsNextTrack=0!==(32&t.attributes.supported_media_commands),this.supportsTurnOn=0!==(128&t.attributes.supported_media_commands),this.supportsTurnOff=0!==(256&t.attributes.supported_media_commands),this.supportsVolumeButtons=0!==(1024&t.attributes.supported_media_commands)}this.async(function(){return e.fire("iron-resize")},500)},computeClassNames:function(t){return(0,c["default"])(t,f)},computeIsOff:function(t){return"off"===t.state},computeMuteVolumeIcon:function(t){return t?"mdi:volume-off":"mdi:volume-high"},computeHideVolumeButtons:function(t,e){return!e||t},computeShowPlaybackControls:function(t,e){return!t&&e},computePlaybackControlIcon:function(){return this.isPlaying?this.supportsPause?"mdi:pause":"mdi:stop":"mdi:play"},computeHidePowerButton:function(t,e,n){return t?!e:!n},handleTogglePower:function(){this.callService(this.isOff?"turn_on":"turn_off")},handlePrevious:function(){this.callService("media_previous_track")},handlePlaybackControl:function(){this.callService("media_play_pause")},handleNext:function(){this.callService("media_next_track")},handleVolumeTap:function(){this.supportsVolumeMute&&this.callService("volume_mute",{is_volume_muted:!this.isMuted})},handleVolumeUp:function(){var t=this.$.volumeUp;this.handleVolumeWorker("volume_up",t,!0)},handleVolumeDown:function(){var t=this.$.volumeDown;this.handleVolumeWorker("volume_down",t,!0)},handleVolumeWorker:function(t,e,n){var r=this;(n||void 0!==e&&e.pointerDown)&&(this.callService(t),this.async(function(){return r.handleVolumeWorker(t,e,!1)},500))},volumeSliderChanged:function(t){var e=parseFloat(t.target.value),n=e>0?e/100:0;this.callService("volume_set",{volume_level:n})},callService:function(t,e){var n=e||{};n.entity_id=this.stateObj.entityId,l.callService("media_player",t,n)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);e["default"]=new o["default"]({is:"more-info-script",properties:{stateObj:{type:Object}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a),s=n(61),c=r(s),l=u["default"].util.parseDateTime;e["default"]=new o["default"]({is:"more-info-sun",properties:{stateObj:{type:Object},risingDate:{type:Object,computed:"computeRising(stateObj)"},settingDate:{type:Object,computed:"computeSetting(stateObj)"}},computeRising:function(t){return l(t.attributes.next_rising)},computeSetting:function(t){return l(t.attributes.next_setting)},computeOrder:function(t,e){return t>e?["set","ris"]:["ris","set"]},itemCaption:function(t){return"ris"===t?"Rising ":"Setting "},itemDate:function(t){return"ris"===t?this.risingDate:this.settingDate},itemValue:function(t){return(0,c["default"])(this.itemDate(t))}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(33),c=r(s),l=o["default"].serviceActions,f=["away_mode"];e["default"]=new u["default"]({is:"more-info-thermostat",properties:{stateObj:{type:Object,observer:"stateObjChanged"},tempMin:{type:Number},tempMax:{type:Number},targetTemperatureSliderValue:{type:Number},awayToggleChecked:{type:Boolean}},stateObjChanged:function(t){this.targetTemperatureSliderValue=t.attributes.temperature,this.awayToggleChecked="on"===t.attributes.away_mode,this.tempMin=t.attributes.min_temp,this.tempMax=t.attributes.max_temp},computeClassNames:function(t){return(0,c["default"])(t,f)},targetTemperatureSliderChanged:function(t){l.callService("thermostat","set_temperature",{entity_id:this.stateObj.entityId,temperature:t.target.value})},toggleChanged:function(t){var e=t.target.checked;e&&"off"===this.stateObj.attributes.away_mode?this.service_set_away(!0):e||"on"!==this.stateObj.attributes.away_mode||this.service_set_away(!1)},service_set_away:function(t){var e=this;l.callService("thermostat","set_away_mode",{away_mode:t,entity_id:this.stateObj.entityId}).then(function(){return e.stateObjChanged(e.stateObj)})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);e["default"]=new o["default"]({is:"more-info-updater",properties:{}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(7),n(59),e["default"]=new o["default"]({is:"state-card-configurator",properties:{inDialog:{type:Boolean,value:!1},stateObj:{type:Object}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a);n(7);var s=o["default"].serviceActions;e["default"]=new u["default"]({is:"state-card-input_select",properties:{detailed:{type:Boolean,value:!1},stateObj:{type:Object},selectedOption:{type:String,observer:"selectedOptionChanged"}},computeSelected:function(t){return t.attributes.options.indexOf(t.state)},selectedOptionChanged:function(t){""!==t&&t!==this.stateObj.state&&s.callService("input_select","select_option",{option:t,entity_id:this.stateObj.entityId})},stopPropagation:function(t){t.stopPropagation()}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a);n(7);var s=o["default"].serviceActions;e["default"]=new u["default"]({is:"state-card-input_slider",properties:{detailed:{type:Boolean,value:!1},stateObj:{type:Object,observer:"stateObjectChanged"},min:{type:Number},max:{type:Number},step:{type:Number},value:{type:Number}},stateObjectChanged:function(t){this.value=Number(t.state),this.min=Number(t.attributes.min),this.max=Number(t.attributes.max),this.step=Number(t.attributes.step)},selectedValueChanged:function(){this.value!==Number(this.stateObj.state)&&s.callService("input_slider","select_value",{value:this.value,entity_id:this.stateObj.entityId})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(7);var a=["playing","paused"];e["default"]=new o["default"]({is:"state-card-media_player",properties:{detailed:{type:Boolean,value:!1},stateObj:{type:Object},isPlaying:{type:Boolean,computed:"computeIsPlaying(stateObj)"},secondaryText:{type:String,computed:"computeSecondaryText(stateObj)"}},computeIsPlaying:function(t){return-1!==a.indexOf(t.state)},computePrimaryText:function(t,e){return e?t.attributes.media_title:t.stateDisplay},computeSecondaryText:function(t){var e=void 0;return"music"===t.attributes.media_content_type?t.attributes.media_artist:"tvshow"===t.attributes.media_content_type?(e=t.attributes.media_series_title,t.attributes.media_season&&t.attributes.media_episode&&(e+=" S"+t.attributes.media_season+"E"+t.attributes.media_episode),e):t.attributes.app_name?t.attributes.app_name:""}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a);n(7);var s=o["default"].serviceActions;e["default"]=new u["default"]({is:"state-card-rollershutter",properties:{detailed:{type:Boolean,value:!1},stateObj:{type:Object}},computeIsFullyOpen:function(t){return 100===t.attributes.current_position},computeIsFullyClosed:function(t){return 0===t.attributes.current_position},onMoveUpTap:function(){s.callService("rollershutter","move_up",{entity_id:this.stateObj.entityId})},onMoveDownTap:function(){s.callService("rollershutter","move_down",{entity_id:this.stateObj.entityId})},onStopTap:function(){s.callService("rollershutter","stop",{entity_id:this.stateObj.entityId})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a);n(7);var s=u["default"].serviceActions;e["default"]=new o["default"]({is:"state-card-scene",properties:{detailed:{type:Boolean,value:!1},stateObj:{type:Object}},activateScene:function(t){t.stopPropagation(),s.callTurnOn(this.stateObj.entityId)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a);n(7),n(29);var s=u["default"].serviceActions;e["default"]=new o["default"]({is:"state-card-script",properties:{detailed:{type:Boolean,value:!1},stateObj:{type:Object}},fireScript:function(t){t.stopPropagation(),s.callTurnOn(this.stateObj.entityId)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(7),e["default"]=new o["default"]({is:"state-card-thermostat",properties:{detailed:{type:Boolean,value:!1},stateObj:{type:Object}},computeTargetTemperature:function(t){return t.attributes.temperature+" "+t.attributes.unit_of_measurement}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(7),n(29),e["default"]=new o["default"]({is:"state-card-toggle",properties:{detailed:{type:Boolean,value:!1},stateObj:{type:Object}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(7),e["default"]=new o["default"]({is:"state-card-weblink",properties:{detailed:{type:Boolean,value:!1},stateObj:{type:Object}},listeners:{tap:"onTap"},onTap:function(t){t.stopPropagation(),t.target!==this.$.link&&window.open(this.stateObj.state,"_blank")}})},function(t,e){"use strict";function n(t){return{attached:function(){var e=this;this.__unwatchFns=Object.keys(this.properties).reduce(function(n,r){if(!("bindNuclear"in e.properties[r]))return n;var i=e.properties[r].bindNuclear;if(!i)throw new Error("Undefined getter specified for key "+r);return e[r]=t.evaluate(i),n.concat(t.observe(i,function(t){e[r]=t}))},[])},detached:function(){for(;this.__unwatchFns.length;)this.__unwatchFns.shift()()}}}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=["off","closed","unlocked"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){return"unavailable"===t.state?"display":-1!==u.indexOf(t.domain)?t.domain:(0,a["default"])(t.entityId)?"toggle":"display"}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var o=n(34),a=r(o),u=["configurator","input_select","input_slider","media_player","rollershutter","scene","script","thermostat","weblink"]},function(t,e){"use strict";function n(t){return-1!==r.indexOf(t.domain)?t.domain:"default"}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n;var r=["light","group","sun","configurator","thermostat","script","media_player","camera","updater","alarm_control_panel","lock"]},function(t,e,n){var r;(function(t,i,o){(function(){"use strict";function a(t){return"function"==typeof t||"object"==typeof t&&null!==t}function u(t){return"function"==typeof t}function s(t){q=t}function c(t){Z=t}function l(){return function(){t.nextTick(_)}}function f(){return function(){W(_)}}function d(){var t=0,e=new tt(_),n=document.createTextNode("");return e.observe(n,{characterData:!0}),function(){n.data=t=++t%2}}function h(){var t=new MessageChannel;return t.port1.onmessage=_,function(){t.port2.postMessage(0)}}function p(){return function(){setTimeout(_,1)}}function _(){for(var t=0;$>t;t+=2){var e=rt[t],n=rt[t+1];e(n),rt[t]=void 0,rt[t+1]=void 0}$=0}function v(){try{var t=n(223);return W=t.runOnLoop||t.runOnContext,f()}catch(e){return p()}}function y(t,e){var n=this,r=n._state;if(r===ut&&!t||r===st&&!e)return this;var i=new this.constructor(g),o=n._result;if(r){var a=arguments[r-1];Z(function(){N(r,i,a,o)})}else P(n,i,t,e);return i}function m(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(g);return E(n,t),n}function g(){}function b(){return new TypeError("You cannot resolve a promise with itself")}function S(){return new TypeError("A promises callback cannot return that same promise.")}function w(t){try{return t.then}catch(e){return ct.error=e,ct}}function O(t,e,n,r){try{t.call(e,n,r)}catch(i){return i}}function M(t,e,n){ Z(function(t){var r=!1,i=O(n,e,function(n){r||(r=!0,e!==n?E(t,n):j(t,n))},function(e){r||(r=!0,C(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&i&&(r=!0,C(t,i))},t)}function I(t,e){e._state===ut?j(t,e._result):e._state===st?C(t,e._result):P(e,void 0,function(e){E(t,e)},function(e){C(t,e)})}function T(t,e,n){e.constructor===t.constructor&&n===it&&constructor.resolve===ot?I(t,e):n===ct?C(t,ct.error):void 0===n?j(t,e):u(n)?M(t,e,n):j(t,e)}function E(t,e){t===e?C(t,b()):a(e)?T(t,e,w(e)):j(t,e)}function D(t){t._onerror&&t._onerror(t._result),A(t)}function j(t,e){t._state===at&&(t._result=e,t._state=ut,0!==t._subscribers.length&&Z(A,t))}function C(t,e){t._state===at&&(t._state=st,t._result=e,Z(D,t))}function P(t,e,n,r){var i=t._subscribers,o=i.length;t._onerror=null,i[o]=e,i[o+ut]=n,i[o+st]=r,0===o&&t._state&&Z(A,t)}function A(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r,i,o=t._result,a=0;aa;a++)P(r.resolve(t[a]),void 0,e,n);return i}function Y(t){var e=this,n=new e(g);return C(n,t),n}function z(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function U(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function V(t){this._id=pt++,this._state=void 0,this._result=void 0,this._subscribers=[],g!==t&&("function"!=typeof t&&z(),this instanceof V?x(this,t):U())}function B(t,e){this._instanceConstructor=t,this.promise=new t(g),Array.isArray(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?j(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&j(this.promise,this._result))):C(this.promise,this._validationError())}function G(){var t;if("undefined"!=typeof i)t=i;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;n&&"[object Promise]"===Object.prototype.toString.call(n.resolve())&&!n.cast||(t.Promise=_t)}var F;F=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var W,q,K,J=F,$=0,Z=function(t,e){rt[$]=t,rt[$+1]=e,$+=2,2===$&&(q?q(_):K())},X="undefined"!=typeof window?window:void 0,Q=X||{},tt=Q.MutationObserver||Q.WebKitMutationObserver,et="undefined"!=typeof t&&"[object process]"==={}.toString.call(t),nt="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,rt=new Array(1e3);K=et?l():tt?d():nt?h():void 0===X?v():p();var it=y,ot=m,at=void 0,ut=1,st=2,ct=new k,lt=new k,ft=R,dt=H,ht=Y,pt=0,_t=V;V.all=ft,V.race=dt,V.resolve=ot,V.reject=ht,V._setScheduler=s,V._setAsap=c,V._asap=Z,V.prototype={constructor:V,then:it,"catch":function(t){return this.then(null,t)}};var vt=B;B.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},B.prototype._enumerate=function(){for(var t=this.length,e=this._input,n=0;this._state===at&&t>n;n++)this._eachEntry(e[n],n)},B.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===ot){var i=w(t);if(i===it&&t._state!==at)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(n===_t){var o=new n(g);T(o,t,i),this._willSettleAt(o,e)}else this._willSettleAt(new n(function(e){e(t)}),e)}else this._willSettleAt(r(t),e)},B.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===at&&(this._remaining--,t===st?C(r,n):this._result[e]=n),0===this._remaining&&j(r,this._result)},B.prototype._willSettleAt=function(t,e){var n=this;P(t,void 0,function(t){n._settledAt(ut,e,t)},function(t){n._settledAt(st,e,t)})};var yt=G,mt={Promise:_t,polyfill:yt};n(222).amd?(r=function(){return mt}.call(e,n,e,o),!(void 0!==r&&(o.exports=r))):"undefined"!=typeof o&&o.exports?o.exports=mt:"undefined"!=typeof this&&(this.ES6Promise=mt),yt()}).call(this)}).call(e,n(221),function(){return this}(),n(69)(t))},function(t,e){function n(t){return function(e){return null==e?void 0:e[t]}}t.exports=n},function(t,e){function n(t,e,n,o){for(var a=-1,u=i(r((e-t)/(n||1)),0),s=Array(u);u--;)s[o?u:++a]=t,t+=n;return s}var r=Math.ceil,i=Math.max;t.exports=n},function(t,e,n){function r(t){return function(e,n,r){return r&&"number"!=typeof r&&o(e,n,r)&&(n=r=void 0),e=a(e),e=e===e?e:0,void 0===n?(n=e,e=0):n=a(n)||0,r=void 0===r?n>e?1:-1:a(r)||0,i(e,n,r,t)}}var i=n(207),o=n(211),a=n(66);t.exports=r},function(t,e,n){var r=n(206),i=r("length");t.exports=i},function(t,e){function n(t,e){return t="number"==typeof t||i.test(t)?+t:-1,e=null==e?r:e,t>-1&&t%1==0&&e>t}var r=9007199254740991,i=/^(?:0|[1-9]\d*)$/;t.exports=n},function(t,e,n){function r(t,e,n){if(!u(n))return!1;var r=typeof e;return("number"==r?o(n)&&a(e,n.length):"string"==r&&e in n)?i(n[e],t):!1}var i=n(212),o=n(214),a=n(210),u=n(17);t.exports=r},function(t,e){function n(t,e){return t===e||t!==t&&e!==e}t.exports=n},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){function r(t){return null!=t&&a(i(t))&&!o(t)}var i=n(209),o=n(37),a=n(215);t.exports=r},function(t,e){function n(t){return"number"==typeof t&&t>-1&&t%1==0&&r>=t}var r=9007199254740991;t.exports=n},function(t,e){function n(t){return!!t&&"object"==typeof t}t.exports=n},function(t,e,n){function r(t){return"symbol"==typeof t||i(t)&&u.call(t)==o}var i=n(216),o="[object Symbol]",a=Object.prototype,u=a.toString;t.exports=r},function(t,e){var n=Date.now;t.exports=n},function(t,e,n){var r=n(208),i=r();t.exports=i},function(t,e){function n(t){throw new Error("Cannot find module '"+t+"'.")}n.keys=function(){return[]},n.resolve=n,t.exports=n,n.id=220},function(t,e){function n(){c=!1,a.length?s=a.concat(s):l=-1,s.length&&r()}function r(){if(!c){var t=setTimeout(n);c=!0;for(var e=s.length;e;){for(a=s,s=[];++l1)for(var n=1;n \ No newline at end of file diff --git a/homeassistant/components/frontend/www_static/home-assistant-polymer b/homeassistant/components/frontend/www_static/home-assistant-polymer index a127c74a539..00e575259fe 160000 --- a/homeassistant/components/frontend/www_static/home-assistant-polymer +++ b/homeassistant/components/frontend/www_static/home-assistant-polymer @@ -1 +1 @@ -Subproject commit a127c74a53955149cbd07d8f2e67a7e230513405 +Subproject commit 00e575259fec660d78575e2171888ef3455ca1b2 From 24257fe4a381906e7a4debfb6c38fa84d4e825d8 Mon Sep 17 00:00:00 2001 From: Josh Wright Date: Sun, 10 Apr 2016 13:41:13 -0400 Subject: [PATCH 017/114] Don't round values in Thermostat internal state (#1782) Since all values coming out of the Thermostat component pass though the _convert_for_display() method (which handles any necessary rounding), there is no need to round values that only exist in the internal state of the thermostat device. It serves no purpose and risks rounding errors/precision loss. --- homeassistant/components/thermostat/__init__.py | 4 ++-- homeassistant/components/thermostat/nest.py | 12 ++++++------ homeassistant/components/thermostat/radiotherm.py | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/thermostat/__init__.py b/homeassistant/components/thermostat/__init__.py index b26a0fd5a05..eb1b926a2e3 100644 --- a/homeassistant/components/thermostat/__init__.py +++ b/homeassistant/components/thermostat/__init__.py @@ -270,12 +270,12 @@ class ThermostatDevice(Entity): @property def min_temp(self): """Return the minimum temperature.""" - return round(convert(7, TEMP_CELCIUS, self.unit_of_measurement)) + return convert(7, TEMP_CELCIUS, self.unit_of_measurement) @property def max_temp(self): """Return the maximum temperature.""" - return round(convert(35, TEMP_CELCIUS, self.unit_of_measurement)) + return convert(35, TEMP_CELCIUS, self.unit_of_measurement) def _convert_for_display(self, temp): """Convert temperature into preferred units for display purposes.""" diff --git a/homeassistant/components/thermostat/nest.py b/homeassistant/components/thermostat/nest.py index 247fccc2d79..1891fa79c70 100644 --- a/homeassistant/components/thermostat/nest.py +++ b/homeassistant/components/thermostat/nest.py @@ -70,7 +70,7 @@ class NestThermostat(ThermostatDevice): @property def current_temperature(self): """Return the current temperature.""" - return round(self.device.temperature, 1) + return self.device.temperature @property def operation(self): @@ -102,21 +102,21 @@ class NestThermostat(ThermostatDevice): else: temp = target - return round(temp, 1) + return temp @property def target_temperature_low(self): """Return the lower bound temperature we try to reach.""" if self.device.mode == 'range': - return round(self.device.target[0], 1) - return round(self.target_temperature, 1) + return self.device.target[0] + return self.target_temperature @property def target_temperature_high(self): """Return the upper bound temperature we try to reach.""" if self.device.mode == 'range': - return round(self.device.target[1], 1) - return round(self.target_temperature, 1) + return self.device.target[1] + return self.target_temperature @property def is_away_mode_on(self): diff --git a/homeassistant/components/thermostat/radiotherm.py b/homeassistant/components/thermostat/radiotherm.py index 3ff5d275194..a6ae39434e7 100644 --- a/homeassistant/components/thermostat/radiotherm.py +++ b/homeassistant/components/thermostat/radiotherm.py @@ -80,7 +80,7 @@ class RadioThermostat(ThermostatDevice): @property def current_temperature(self): """Return the current temperature.""" - return round(self._current_temperature, 1) + return self._current_temperature @property def operation(self): @@ -90,7 +90,7 @@ class RadioThermostat(ThermostatDevice): @property def target_temperature(self): """Return the temperature we try to reach.""" - return round(self._target_temperature, 1) + return self._target_temperature def update(self): """Update the data from the thermostat.""" From d3493c7e5a0c936a3ed61c484bb90bbda8606e2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=B8yer=20Iversen?= Date: Sun, 10 Apr 2016 19:43:05 +0200 Subject: [PATCH 018/114] Config validation of yr sensor (#1767) --- homeassistant/components/sensor/yr.py | 20 ++++++++++------ tests/components/sensor/test_yr.py | 34 ++++++++++----------------- 2 files changed, 26 insertions(+), 28 deletions(-) diff --git a/homeassistant/components/sensor/yr.py b/homeassistant/components/sensor/yr.py index 0286fd834dd..3a434e30a85 100644 --- a/homeassistant/components/sensor/yr.py +++ b/homeassistant/components/sensor/yr.py @@ -5,9 +5,10 @@ For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.yr/ """ import logging - import requests +import voluptuous as vol +import homeassistant.helpers.config_validation as cv from homeassistant.const import CONF_LATITUDE, CONF_LONGITUDE from homeassistant.helpers.entity import Entity from homeassistant.util import dt as dt_util @@ -18,6 +19,8 @@ _LOGGER = logging.getLogger(__name__) REQUIREMENTS = ['xmltodict'] +CONF_MONITORED_CONDITIONS = 'monitored_conditions' + # Sensor types are defined like so: SENSOR_TYPES = { 'symbol': ['Symbol', None], @@ -36,6 +39,13 @@ SENSOR_TYPES = { 'dewpointTemperature': ['Dewpoint temperature', '°C'], } +PLATFORM_SCHEMA = vol.Schema({ + vol.Required('platform'): 'yr', + vol.Optional(CONF_MONITORED_CONDITIONS, default=[]): + [vol.In(SENSOR_TYPES.keys())], + vol.Optional('elevation'): cv.positive_int, +}) + def setup_platform(hass, config, add_devices, discovery_info=None): """Setup the Yr.no sensor.""" @@ -58,12 +68,8 @@ def setup_platform(hass, config, add_devices, discovery_info=None): weather = YrData(coordinates) dev = [] - if 'monitored_conditions' in config: - for variable in config['monitored_conditions']: - if variable not in SENSOR_TYPES: - _LOGGER.error('Sensor type: "%s" does not exist', variable) - else: - dev.append(YrSensor(variable, weather)) + for sensor_type in config[CONF_MONITORED_CONDITIONS]: + dev.append(YrSensor(sensor_type, weather)) # add symbol as default sensor if len(dev) == 0: diff --git a/tests/components/sensor/test_yr.py b/tests/components/sensor/test_yr.py index aa15d7cf3ea..c60324e38b9 100644 --- a/tests/components/sensor/test_yr.py +++ b/tests/components/sensor/test_yr.py @@ -4,9 +4,8 @@ from unittest.mock import patch import pytest -import homeassistant.components.sensor as sensor +from homeassistant.bootstrap import _setup_component import homeassistant.util.dt as dt_util - from tests.common import get_test_home_assistant @@ -32,12 +31,9 @@ class TestSensorYr: return_value=betamax_session): with patch('homeassistant.components.sensor.yr.dt_util.utcnow', return_value=now): - assert sensor.setup(self.hass, { - 'sensor': { - 'platform': 'yr', - 'elevation': 0, - } - }) + assert _setup_component(self.hass, 'sensor', { + 'sensor': {'platform': 'yr', + 'elevation': 0}}) state = self.hass.states.get('sensor.yr_symbol') @@ -53,19 +49,15 @@ class TestSensorYr: return_value=betamax_session): with patch('homeassistant.components.sensor.yr.dt_util.utcnow', return_value=now): - assert sensor.setup(self.hass, { - 'sensor': { - 'platform': 'yr', - 'elevation': 0, - 'monitored_conditions': { - 'pressure', - 'windDirection', - 'humidity', - 'fog', - 'windSpeed' - } - } - }) + assert _setup_component(self.hass, 'sensor', { + 'sensor': {'platform': 'yr', + 'elevation': 0, + 'monitored_conditions': [ + 'pressure', + 'windDirection', + 'humidity', + 'fog', + 'windSpeed']}}) state = self.hass.states.get('sensor.yr_pressure') assert 'hPa' == state.attributes.get('unit_of_measurement') From 6d65b0bbd7924d065aeade3f993c80abc1376ace Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 10 Apr 2016 15:18:44 -0700 Subject: [PATCH 019/114] Update frontend --- homeassistant/components/frontend/version.py | 2 +- .../frontend/www_static/frontend.html | 21 ++++++++++++------- .../www_static/home-assistant-polymer | 2 +- 3 files changed, 15 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/frontend/version.py b/homeassistant/components/frontend/version.py index 1d137f6f83a..f923e425cbe 100644 --- a/homeassistant/components/frontend/version.py +++ b/homeassistant/components/frontend/version.py @@ -1,2 +1,2 @@ """DO NOT MODIFY. Auto-generated by build_frontend script.""" -VERSION = "50a185fc83edd53abb848ba9e6f8931e" +VERSION = "7baf9a2bf8d94448eeaa6a1ceaf8464e" diff --git a/homeassistant/components/frontend/www_static/frontend.html b/homeassistant/components/frontend/www_static/frontend.html index bef20c0fcac..c2837769665 100644 --- a/homeassistant/components/frontend/www_static/frontend.html +++ b/homeassistant/components/frontend/www_static/frontend.html @@ -3759,13 +3759,18 @@ e.bindAnimationForKeyframeEffect(this)),(this.effect instanceof window.SequenceE text-align: center; } - .primary { - width: 60px; - height: 60px; + .controls paper-icon-button { + width: 44px; + height: 44px; + } + + paper-icon-button.primary { + width: 56px !important; + height: 56px !important; background-color: var(--primary-color); color: white; border-radius: 50%; - padding: 5px; + padding: 8px; } [invisible] { @@ -3810,7 +3815,7 @@ e.bindAnimationForKeyframeEffect(this)),(this.effect instanceof window.SequenceE .column { max-width: 600px; } - }
\ No newline at end of file +pane:e})}Object.defineProperty(e,"__esModule",{value:!0}),e.showSidebar=i,e.navigate=o;var a=n(21),u=r(a)},function(t,e){"use strict";function n(t){return[r,function(e){return e===t}]}Object.defineProperty(e,"__esModule",{value:!0}),e.isActivePane=n;var r=e.activePane=["selectedNavigationPanel"];e.showSidebar=["showSidebar"]},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}function o(t){t.registerStores({selectedNavigationPanel:u["default"],showSidebar:c["default"]})}Object.defineProperty(e,"__esModule",{value:!0}),e.urlSync=e.getters=e.actions=void 0,e.register=o;var a=n(105),u=i(a),s=n(106),c=i(s),l=n(43),f=r(l),d=n(44),h=r(d),p=n(107),_=r(p);e.actions=f,e.getters=h,e.urlSync=_},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(6),o=r(i);e["default"]=(0,o["default"])({NOTIFICATION_CREATED:null})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){return[h(t),function(t){return!!t&&t.services.has(e)}]}function o(t){return[u.getters.byId(t),d,f["default"]]}Object.defineProperty(e,"__esModule",{value:!0}),e.byDomain=e.entityMap=e.hasData=void 0,e.hasService=i,e.canToggleEntity=o;var a=n(10),u=n(8),s=n(48),c=r(s),l=n(117),f=r(l),d=(e.hasData=(0,a.createHasDataGetter)(c["default"]),e.entityMap=(0,a.createEntityMapGetter)(c["default"])),h=e.byDomain=(0,a.createByIdGetter)(c["default"])},function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function i(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function o(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var a=function(){function t(t,e){for(var n=0;n6e4}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(35),u=r(a);e["default"]=new o["default"]({is:"domain-icon",properties:{domain:{type:String,value:""},state:{type:String,value:""}},computeIcon:function(t,e){return(0,u["default"])(t,e)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);e["default"]=new o["default"]({is:"ha-card",properties:{header:{type:String},elevation:{type:Number,value:1,reflectToAttribute:!0}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(67),o=r(i),a=n(2),u=r(a),s=n(1),c=r(s),l=6e4,f=u["default"].util.parseDateTime;e["default"]=new c["default"]({is:"relative-ha-datetime",properties:{datetime:{type:String,observer:"datetimeChanged"},datetimeObj:{type:Object,observer:"datetimeObjChanged"},parsedDateTime:{type:Object},relativeTime:{type:String,value:"not set"}},created:function(){this.updateRelative=this.updateRelative.bind(this)},attached:function(){this._interval=setInterval(this.updateRelative,l)},detached:function(){clearInterval(this._interval)},datetimeChanged:function(t){this.parsedDateTime=t?f(t):null,this.updateRelative()},datetimeObjChanged:function(t){this.parsedDateTime=t,this.updateRelative()},updateRelative:function(){this.relativeTime=this.parsedDateTime?(0,o["default"])(this.parsedDateTime).fromNow():""}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(31),n(162),n(161),e["default"]=new o["default"]({is:"state-history-charts",properties:{stateHistory:{type:Object},isLoadingData:{type:Boolean,value:!1},apiLoaded:{type:Boolean,value:!1},isLoading:{type:Boolean,computed:"computeIsLoading(isLoadingData, apiLoaded)"},groupedStateHistory:{type:Object,computed:"computeGroupedStateHistory(isLoading, stateHistory)"},isSingleDevice:{type:Boolean,computed:"computeIsSingleDevice(stateHistory)"}},computeIsSingleDevice:function(t){return t&&1===t.size},computeGroupedStateHistory:function(t,e){if(t||!e)return{line:[],timeline:[]};var n={},r=[];e.forEach(function(t){if(t&&0!==t.size){var e=t.find(function(t){return"unit_of_measurement"in t.attributes}),i=e?e.attributes.unit_of_measurement:!1;i?i in n?n[i].push(t.toArray()):n[i]=[t.toArray()]:r.push(t.toArray())}}),r=r.length>0&&r;var i=Object.keys(n).map(function(t){return[t,n[t]]});return{line:i,timeline:r}},googleApiLoaded:function(){var t=this;window.google.load("visualization","1",{packages:["timeline","corechart"],callback:function(){t.apiLoaded=!0}})},computeContentClasses:function(t){return t?"loading":""},computeIsLoading:function(t,e){return t||!e},computeIsEmpty:function(t){return t&&0===t.size},extractUnit:function(t){return t[0]},extractData:function(t){return t[1]}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(7),e["default"]=new o["default"]({is:"state-card-display",properties:{detailed:{type:Boolean,value:!1},stateObj:{type:Object}}})},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]="mdi:bookmark"},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){return(0,a["default"])(t).format("LT")}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var o=n(67),a=r(o)},function(t,e){"use strict";function n(){var t=document.getElementById("ha-init-skeleton");t&&t.parentElement.removeChild(t)}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){var e=t.state&&"off"===t.state;switch(t.attributes.sensor_class){case"opening":return e?"mdi:crop-square":"mdi:exit-to-app";case"moisture":return e?"mdi:water-off":"mdi:water";case"light":return e?"mdi:brightness-5":"mdi:brightness-7";case"sound":return e?"mdi:music-note-off":"mdi:music-note";case"vibration":return e?"mdi:crop-portrait":"mdi:vibrate";case"connectivity":return e?"mdi:server-network-off":"mdi:server-network";case"safety":case"gas":case"smoke":case"power":return e?"mdi:verified":"mdi:alert";case"motion":return e?"mdi:walk":"mdi:run";case"digital":default:return e?"mdi:radiobox-blank":"mdi:checkbox-marked-circle"}}function o(t){if(!t)return u["default"];if(t.attributes.icon)return t.attributes.icon;var e=t.attributes.unit_of_measurement;if(e&&"sensor"===t.domain){if(e===d.UNIT_TEMP_C||e===d.UNIT_TEMP_F)return"mdi:thermometer";if("Mice"===e)return"mdi:mouse-variant"}else if("binary_sensor"===t.domain)return i(t);return(0,c["default"])(t.domain,t.state)}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=o;var a=n(60),u=r(a),s=n(35),c=r(s),l=n(2),f=r(l),d=f["default"].util.temperatureUnits},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=function(t,e){a.validate(t,{rememberAuth:e,useStreaming:u.useStreaming})};var i=n(2),o=r(i),a=o["default"].authActions,u=o["default"].localStoragePreferences},function(t,e,n){function r(t,e,n){function r(e){var n=m,r=g;return m=g=void 0,O=e,b=t.apply(r,n)}function l(t){return O=t,S=setTimeout(h,e),M?r(t):b}function f(t){var n=t-w,r=t-O,i=e-n;return I===!1?i:c(i,I-r)}function d(t){var n=t-w,r=t-O;return!w||n>=e||0>n||I!==!1&&r>=I}function h(){var t=o();return d(t)?p(t):void(S=setTimeout(h,f(t)))}function p(t){return clearTimeout(S),S=void 0,T&&m?r(t):(m=g=void 0,b)}function _(){void 0!==S&&clearTimeout(S),w=O=0,m=g=S=void 0}function v(){return void 0===S?b:p(o())}function y(){var t=o(),n=d(t);return m=arguments,g=this,w=t,n?void 0===S?l(w):(clearTimeout(S),S=setTimeout(h,e),r(w)):b}var m,g,b,S,w=0,O=0,M=!1,I=!1,T=!0;if("function"!=typeof t)throw new TypeError(u);return e=a(e)||0,i(n)&&(M=!!n.leading,I="maxWait"in n&&s(a(n.maxWait)||0,e),T="trailing"in n?!!n.trailing:T),y.cancel=_,y.flush=v,y}var i=n(17),o=n(219),a=n(66),u="Expected a function",s=Math.max,c=Math.min;t.exports=r},function(t,e,n){function r(t){if("number"==typeof t)return t;if(a(t))return u;if(o(t)){var e=i(t.valueOf)?t.valueOf():t;t=o(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(s,"");var n=l.test(t);return n||f.test(t)?d(t.slice(2),n?2:8):c.test(t)?u:+t}var i=n(37),o=n(17),a=n(218),u=NaN,s=/^\s+|\s+$/g,c=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,f=/^0o[0-7]+$/i,d=parseInt;t.exports=r},function(t,e,n){(function(t){!function(e,n){t.exports=n()}(this,function(){"use strict";function e(){return Qn.apply(null,arguments)}function n(t){Qn=t}function r(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function i(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function o(t,e){var n,r=[];for(n=0;n0)for(n in tr)r=tr[n],i=e[r],h(i)||(t[r]=i);return t}function _(t){p(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),er===!1&&(er=!0,e.updateOffset(this),er=!1)}function v(t){return t instanceof _||null!=t&&null!=t._isAMomentObject}function y(t){return 0>t?Math.ceil(t):Math.floor(t)}function m(t){var e=+t,n=0;return 0!==e&&isFinite(e)&&(n=y(e)),n}function g(t,e,n){var r,i=Math.min(t.length,e.length),o=Math.abs(t.length-e.length),a=0;for(r=0;i>r;r++)(n&&t[r]!==e[r]||!n&&m(t[r])!==m(e[r]))&&a++;return a+o}function b(t){e.suppressDeprecationWarnings===!1&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function S(t,e){var n=!0;return u(function(){return n&&(b(t+"\nArguments: "+Array.prototype.slice.call(arguments).join(", ")+"\n"+(new Error).stack),n=!1),e.apply(this,arguments)},e)}function w(t,e){nr[t]||(b(e),nr[t]=!0)}function O(t){return t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function M(t){return"[object Object]"===Object.prototype.toString.call(t)}function I(t){var e,n;for(n in t)e=t[n],O(e)?this[n]=e:this["_"+n]=e;this._config=t,this._ordinalParseLenient=new RegExp(this._ordinalParse.source+"|"+/\d{1,2}/.source)}function T(t,e){var n,r=u({},t);for(n in e)a(e,n)&&(M(t[n])&&M(e[n])?(r[n]={},u(r[n],t[n]),u(r[n],e[n])):null!=e[n]?r[n]=e[n]:delete r[n]);return r}function E(t){null!=t&&this.set(t)}function D(t){return t?t.toLowerCase().replace("_","-"):t}function j(t){for(var e,n,r,i,o=0;o0;){if(r=C(i.slice(0,e).join("-")))return r;if(n&&n.length>=e&&g(i,n,!0)>=e-1)break;e--}o++}return null}function C(e){var n=null;if(!ir[e]&&"undefined"!=typeof t&&t&&t.exports)try{n=rr._abbr,!function(){var t=new Error('Cannot find module "./locale"');throw t.code="MODULE_NOT_FOUND",t}(),P(n)}catch(r){}return ir[e]}function P(t,e){var n;return t&&(n=h(e)?L(t):A(t,e),n&&(rr=n)),rr._abbr}function A(t,e){return null!==e?(e.abbr=t,null!=ir[t]?(w("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale"),e=T(ir[t]._config,e)):null!=e.parentLocale&&(null!=ir[e.parentLocale]?e=T(ir[e.parentLocale]._config,e):w("parentLocaleUndefined","specified parentLocale is not defined yet")),ir[t]=new E(e),P(t),ir[t]):(delete ir[t],null)}function k(t,e){if(null!=e){var n;null!=ir[t]&&(e=T(ir[t]._config,e)),n=new E(e),n.parentLocale=ir[t],ir[t]=n,P(t)}else null!=ir[t]&&(null!=ir[t].parentLocale?ir[t]=ir[t].parentLocale:null!=ir[t]&&delete ir[t]);return ir[t]}function L(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return rr;if(!r(t)){if(e=C(t))return e;t=[t]}return j(t)}function N(){return Object.keys(ir)}function x(t,e){var n=t.toLowerCase();or[n]=or[n+"s"]=or[e]=t}function R(t){return"string"==typeof t?or[t]||or[t.toLowerCase()]:void 0}function H(t){var e,n,r={};for(n in t)a(t,n)&&(e=R(n),e&&(r[e]=t[n]));return r}function Y(t,n){return function(r){return null!=r?(U(this,t,r),e.updateOffset(this,n),this):z(this,t)}}function z(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function U(t,e,n){t.isValid()&&t._d["set"+(t._isUTC?"UTC":"")+e](n)}function V(t,e){var n;if("object"==typeof t)for(n in t)this.set(n,t[n]);else if(t=R(t),O(this[t]))return this[t](e);return this}function B(t,e,n){var r=""+Math.abs(t),i=e-r.length,o=t>=0;return(o?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}function G(t,e,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),t&&(cr[t]=i),e&&(cr[e[0]]=function(){return B(i.apply(this,arguments),e[1],e[2])}),n&&(cr[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),t)})}function F(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function W(t){var e,n,r=t.match(ar);for(e=0,n=r.length;n>e;e++)cr[r[e]]?r[e]=cr[r[e]]:r[e]=F(r[e]);return function(i){var o="";for(e=0;n>e;e++)o+=r[e]instanceof Function?r[e].call(i,t):r[e];return o}}function q(t,e){return t.isValid()?(e=K(e,t.localeData()),sr[e]=sr[e]||W(e),sr[e](t)):t.localeData().invalidDate()}function K(t,e){function n(t){return e.longDateFormat(t)||t}var r=5;for(ur.lastIndex=0;r>=0&&ur.test(t);)t=t.replace(ur,n),ur.lastIndex=0,r-=1;return t}function J(t,e,n){Er[t]=O(e)?e:function(t,r){return t&&n?n:e}}function $(t,e){return a(Er,t)?Er[t](e._strict,e._locale):new RegExp(Z(t))}function Z(t){return X(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(t,e,n,r,i){return e||n||r||i}))}function X(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Q(t,e){var n,r=e;for("string"==typeof t&&(t=[t]),"number"==typeof e&&(r=function(t,n){n[e]=m(t)}),n=0;nr;r++){if(i=s([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(o="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(o.replace(".",""),"i")),n&&"MMMM"===e&&this._longMonthsParse[r].test(t))return r;if(n&&"MMM"===e&&this._shortMonthsParse[r].test(t))return r;if(!n&&this._monthsParse[r].test(t))return r}}function at(t,e){var n;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=m(e);else if(e=t.localeData().monthsParse(e),"number"!=typeof e)return t;return n=Math.min(t.date(),nt(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,n),t}function ut(t){return null!=t?(at(this,t),e.updateOffset(this,!0),this):z(this,"Month")}function st(){return nt(this.year(),this.month())}function ct(t){return this._monthsParseExact?(a(this,"_monthsRegex")||ft.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex}function lt(t){return this._monthsParseExact?(a(this,"_monthsRegex")||ft.call(this),t?this._monthsStrictRegex:this._monthsRegex):this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex}function ft(){function t(t,e){return e.length-t.length}var e,n,r=[],i=[],o=[];for(e=0;12>e;e++)n=s([2e3,e]),r.push(this.monthsShort(n,"")),i.push(this.months(n,"")),o.push(this.months(n,"")),o.push(this.monthsShort(n,""));for(r.sort(t),i.sort(t),o.sort(t),e=0;12>e;e++)r[e]=X(r[e]),i[e]=X(i[e]),o[e]=X(o[e]);this._monthsRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+i.join("|")+")$","i"),this._monthsShortStrictRegex=new RegExp("^("+r.join("|")+")$","i")}function dt(t){var e,n=t._a;return n&&-2===l(t).overflow&&(e=n[Cr]<0||n[Cr]>11?Cr:n[Pr]<1||n[Pr]>nt(n[jr],n[Cr])?Pr:n[Ar]<0||n[Ar]>24||24===n[Ar]&&(0!==n[kr]||0!==n[Lr]||0!==n[Nr])?Ar:n[kr]<0||n[kr]>59?kr:n[Lr]<0||n[Lr]>59?Lr:n[Nr]<0||n[Nr]>999?Nr:-1,l(t)._overflowDayOfYear&&(jr>e||e>Pr)&&(e=Pr),l(t)._overflowWeeks&&-1===e&&(e=xr),l(t)._overflowWeekday&&-1===e&&(e=Rr),l(t).overflow=e),t}function ht(t){var e,n,r,i,o,a,u=t._i,s=Br.exec(u)||Gr.exec(u);if(s){for(l(t).iso=!0,e=0,n=Wr.length;n>e;e++)if(Wr[e][1].exec(s[1])){i=Wr[e][0],r=Wr[e][2]!==!1;break}if(null==i)return void(t._isValid=!1);if(s[3]){for(e=0,n=qr.length;n>e;e++)if(qr[e][1].exec(s[3])){o=(s[2]||" ")+qr[e][0];break}if(null==o)return void(t._isValid=!1)}if(!r&&null!=o)return void(t._isValid=!1);if(s[4]){if(!Fr.exec(s[4]))return void(t._isValid=!1);a="Z"}t._f=i+(o||"")+(a||""),Dt(t)}else t._isValid=!1}function pt(t){var n=Kr.exec(t._i);return null!==n?void(t._d=new Date(+n[1])):(ht(t),void(t._isValid===!1&&(delete t._isValid,e.createFromInputFallback(t))))}function _t(t,e,n,r,i,o,a){var u=new Date(t,e,n,r,i,o,a);return 100>t&&t>=0&&isFinite(u.getFullYear())&&u.setFullYear(t),u}function vt(t){var e=new Date(Date.UTC.apply(null,arguments));return 100>t&&t>=0&&isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t),e}function yt(t){return mt(t)?366:365}function mt(t){return t%4===0&&t%100!==0||t%400===0}function gt(){return mt(this.year())}function bt(t,e,n){var r=7+e-n,i=(7+vt(t,0,r).getUTCDay()-e)%7;return-i+r-1}function St(t,e,n,r,i){var o,a,u=(7+n-r)%7,s=bt(t,r,i),c=1+7*(e-1)+u+s;return 0>=c?(o=t-1,a=yt(o)+c):c>yt(t)?(o=t+1,a=c-yt(t)):(o=t,a=c),{year:o,dayOfYear:a}}function wt(t,e,n){var r,i,o=bt(t.year(),e,n),a=Math.floor((t.dayOfYear()-o-1)/7)+1;return 1>a?(i=t.year()-1,r=a+Ot(i,e,n)):a>Ot(t.year(),e,n)?(r=a-Ot(t.year(),e,n),i=t.year()+1):(i=t.year(),r=a),{week:r,year:i}}function Ot(t,e,n){var r=bt(t,e,n),i=bt(t+1,e,n);return(yt(t)-r+i)/7}function Mt(t,e,n){return null!=t?t:null!=e?e:n}function It(t){var n=new Date(e.now());return t._useUTC?[n.getUTCFullYear(),n.getUTCMonth(),n.getUTCDate()]:[n.getFullYear(),n.getMonth(),n.getDate()]}function Tt(t){var e,n,r,i,o=[];if(!t._d){for(r=It(t),t._w&&null==t._a[Pr]&&null==t._a[Cr]&&Et(t),t._dayOfYear&&(i=Mt(t._a[jr],r[jr]),t._dayOfYear>yt(i)&&(l(t)._overflowDayOfYear=!0),n=vt(i,0,t._dayOfYear),t._a[Cr]=n.getUTCMonth(),t._a[Pr]=n.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=o[e]=r[e];for(;7>e;e++)t._a[e]=o[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[Ar]&&0===t._a[kr]&&0===t._a[Lr]&&0===t._a[Nr]&&(t._nextDay=!0,t._a[Ar]=0),t._d=(t._useUTC?vt:_t).apply(null,o),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Ar]=24)}}function Et(t){var e,n,r,i,o,a,u,s;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(o=1,a=4,n=Mt(e.GG,t._a[jr],wt(xt(),1,4).year),r=Mt(e.W,1),i=Mt(e.E,1),(1>i||i>7)&&(s=!0)):(o=t._locale._week.dow,a=t._locale._week.doy,n=Mt(e.gg,t._a[jr],wt(xt(),o,a).year),r=Mt(e.w,1),null!=e.d?(i=e.d,(0>i||i>6)&&(s=!0)):null!=e.e?(i=e.e+o,(e.e<0||e.e>6)&&(s=!0)):i=o),1>r||r>Ot(n,o,a)?l(t)._overflowWeeks=!0:null!=s?l(t)._overflowWeekday=!0:(u=St(n,r,i,o,a),t._a[jr]=u.year,t._dayOfYear=u.dayOfYear)}function Dt(t){if(t._f===e.ISO_8601)return void ht(t);t._a=[],l(t).empty=!0;var n,r,i,o,a,u=""+t._i,s=u.length,c=0;for(i=K(t._f,t._locale).match(ar)||[],n=0;n0&&l(t).unusedInput.push(a),u=u.slice(u.indexOf(r)+r.length),c+=r.length),cr[o]?(r?l(t).empty=!1:l(t).unusedTokens.push(o),et(o,r,t)):t._strict&&!r&&l(t).unusedTokens.push(o);l(t).charsLeftOver=s-c,u.length>0&&l(t).unusedInput.push(u),l(t).bigHour===!0&&t._a[Ar]<=12&&t._a[Ar]>0&&(l(t).bigHour=void 0),t._a[Ar]=jt(t._locale,t._a[Ar],t._meridiem),Tt(t),dt(t)}function jt(t,e,n){var r;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?(r=t.isPM(n),r&&12>e&&(e+=12),r||12!==e||(e=0),e):e}function Ct(t){var e,n,r,i,o;if(0===t._f.length)return l(t).invalidFormat=!0,void(t._d=new Date(NaN));for(i=0;io)&&(r=o,n=e));u(t,n||e)}function Pt(t){if(!t._d){var e=H(t._i);t._a=o([e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],function(t){return t&&parseInt(t,10)}),Tt(t)}}function At(t){var e=new _(dt(kt(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function kt(t){var e=t._i,n=t._f;return t._locale=t._locale||L(t._l),null===e||void 0===n&&""===e?d({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),v(e)?new _(dt(e)):(r(n)?Ct(t):n?Dt(t):i(e)?t._d=e:Lt(t),f(t)||(t._d=null),t))}function Lt(t){var n=t._i;void 0===n?t._d=new Date(e.now()):i(n)?t._d=new Date(+n):"string"==typeof n?pt(t):r(n)?(t._a=o(n.slice(0),function(t){return parseInt(t,10)}),Tt(t)):"object"==typeof n?Pt(t):"number"==typeof n?t._d=new Date(n):e.createFromInputFallback(t)}function Nt(t,e,n,r,i){var o={};return"boolean"==typeof n&&(r=n,n=void 0),o._isAMomentObject=!0,o._useUTC=o._isUTC=i,o._l=n,o._i=t,o._f=e,o._strict=r,At(o)}function xt(t,e,n,r){return Nt(t,e,n,r,!1)}function Rt(t,e){var n,i;if(1===e.length&&r(e[0])&&(e=e[0]),!e.length)return xt();for(n=e[0],i=1;it&&(t=-t,n="-"),n+B(~~(t/60),2)+e+B(~~t%60,2)})}function Bt(t,e){var n=(e||"").match(t)||[],r=n[n.length-1]||[],i=(r+"").match(Qr)||["-",0,0],o=+(60*i[1])+m(i[2]);return"+"===i[0]?o:-o}function Gt(t,n){var r,o;return n._isUTC?(r=n.clone(),o=(v(t)||i(t)?+t:+xt(t))-+r,r._d.setTime(+r._d+o),e.updateOffset(r,!1),r):xt(t).local()}function Ft(t){return 15*-Math.round(t._d.getTimezoneOffset()/15)}function Wt(t,n){var r,i=this._offset||0;return this.isValid()?null!=t?("string"==typeof t?t=Bt(Mr,t):Math.abs(t)<16&&(t=60*t),!this._isUTC&&n&&(r=Ft(this)),this._offset=t,this._isUTC=!0,null!=r&&this.add(r,"m"),i!==t&&(!n||this._changeInProgress?ce(this,re(t-i,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this):this._isUTC?i:Ft(this):null!=t?this:NaN}function qt(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function Kt(t){return this.utcOffset(0,t)}function Jt(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(Ft(this),"m")),this}function $t(){return this._tzm?this.utcOffset(this._tzm):"string"==typeof this._i&&this.utcOffset(Bt(Or,this._i)),this}function Zt(t){return this.isValid()?(t=t?xt(t).utcOffset():0,(this.utcOffset()-t)%60===0):!1}function Xt(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Qt(){if(!h(this._isDSTShifted))return this._isDSTShifted;var t={};if(p(t,this),t=kt(t),t._a){var e=t._isUTC?s(t._a):xt(t._a);this._isDSTShifted=this.isValid()&&g(t._a,e.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted}function te(){return this.isValid()?!this._isUTC:!1}function ee(){return this.isValid()?this._isUTC:!1}function ne(){return this.isValid()?this._isUTC&&0===this._offset:!1}function re(t,e){var n,r,i,o=t,u=null;return Ut(t)?o={ms:t._milliseconds,d:t._days,M:t._months}:"number"==typeof t?(o={},e?o[e]=t:o.milliseconds=t):(u=ti.exec(t))?(n="-"===u[1]?-1:1,o={y:0,d:m(u[Pr])*n,h:m(u[Ar])*n,m:m(u[kr])*n,s:m(u[Lr])*n,ms:m(u[Nr])*n}):(u=ei.exec(t))?(n="-"===u[1]?-1:1,o={y:ie(u[2],n),M:ie(u[3],n),w:ie(u[4],n),d:ie(u[5],n),h:ie(u[6],n),m:ie(u[7],n),s:ie(u[8],n)}):null==o?o={}:"object"==typeof o&&("from"in o||"to"in o)&&(i=ae(xt(o.from),xt(o.to)),o={},o.ms=i.milliseconds,o.M=i.months),r=new zt(o),Ut(t)&&a(t,"_locale")&&(r._locale=t._locale),r}function ie(t,e){var n=t&&parseFloat(t.replace(",","."));return(isNaN(n)?0:n)*e}function oe(t,e){var n={milliseconds:0,months:0};return n.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(n.months,"M").isAfter(e)&&--n.months,n.milliseconds=+e-+t.clone().add(n.months,"M"),n}function ae(t,e){var n;return t.isValid()&&e.isValid()?(e=Gt(e,t),t.isBefore(e)?n=oe(t,e):(n=oe(e,t),n.milliseconds=-n.milliseconds,n.months=-n.months),n):{milliseconds:0,months:0}}function ue(t){return 0>t?-1*Math.round(-1*t):Math.round(t)}function se(t,e){return function(n,r){var i,o;return null===r||isNaN(+r)||(w(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period)."),o=n,n=r,r=o),n="string"==typeof n?+n:n,i=re(n,r),ce(this,i,t),this}}function ce(t,n,r,i){var o=n._milliseconds,a=ue(n._days),u=ue(n._months);t.isValid()&&(i=null==i?!0:i,o&&t._d.setTime(+t._d+o*r),a&&U(t,"Date",z(t,"Date")+a*r),u&&at(t,z(t,"Month")+u*r),i&&e.updateOffset(t,a||u))}function le(t,e){var n=t||xt(),r=Gt(n,this).startOf("day"),i=this.diff(r,"days",!0),o=-6>i?"sameElse":-1>i?"lastWeek":0>i?"lastDay":1>i?"sameDay":2>i?"nextDay":7>i?"nextWeek":"sameElse",a=e&&(O(e[o])?e[o]():e[o]);return this.format(a||this.localeData().calendar(o,this,xt(n)))}function fe(){return new _(this)}function de(t,e){var n=v(t)?t:xt(t);return this.isValid()&&n.isValid()?(e=R(h(e)?"millisecond":e),"millisecond"===e?+this>+n:+n<+this.clone().startOf(e)):!1}function he(t,e){var n=v(t)?t:xt(t);return this.isValid()&&n.isValid()?(e=R(h(e)?"millisecond":e),"millisecond"===e?+n>+this:+this.clone().endOf(e)<+n):!1}function pe(t,e,n){return this.isAfter(t,n)&&this.isBefore(e,n)}function _e(t,e){var n,r=v(t)?t:xt(t);return this.isValid()&&r.isValid()?(e=R(e||"millisecond"),"millisecond"===e?+this===+r:(n=+r,+this.clone().startOf(e)<=n&&n<=+this.clone().endOf(e))):!1}function ve(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function ye(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function me(t,e,n){var r,i,o,a;return this.isValid()?(r=Gt(t,this),r.isValid()?(i=6e4*(r.utcOffset()-this.utcOffset()),e=R(e),"year"===e||"month"===e||"quarter"===e?(a=ge(this,r),"quarter"===e?a/=3:"year"===e&&(a/=12)):(o=this-r,a="second"===e?o/1e3:"minute"===e?o/6e4:"hour"===e?o/36e5:"day"===e?(o-i)/864e5:"week"===e?(o-i)/6048e5:o),n?a:y(a)):NaN):NaN}function ge(t,e){var n,r,i=12*(e.year()-t.year())+(e.month()-t.month()),o=t.clone().add(i,"months");return 0>e-o?(n=t.clone().add(i-1,"months"),r=(e-o)/(o-n)):(n=t.clone().add(i+1,"months"),r=(e-o)/(n-o)),-(i+r)}function be(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Se(){var t=this.clone().utc();return 0o&&(e=o),qe.call(this,t,e,n,r,i))}function qe(t,e,n,r,i){var o=St(t,e,n,r,i),a=vt(o.year,0,o.dayOfYear);return this.year(a.getUTCFullYear()),this.month(a.getUTCMonth()),this.date(a.getUTCDate()),this}function Ke(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}function Je(t){return wt(t,this._week.dow,this._week.doy).week}function $e(){return this._week.dow}function Ze(){return this._week.doy}function Xe(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Qe(t){var e=wt(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function tn(t,e){return"string"!=typeof t?t:isNaN(t)?(t=e.weekdaysParse(t),"number"==typeof t?t:null):parseInt(t,10)}function en(t,e){return r(this._weekdays)?this._weekdays[t.day()]:this._weekdays[this._weekdays.isFormat.test(e)?"format":"standalone"][t.day()]}function nn(t){return this._weekdaysShort[t.day()]}function rn(t){return this._weekdaysMin[t.day()]}function on(t,e,n){var r,i,o;for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;7>r;r++){if(i=xt([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".",".?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".",".?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".",".?")+"$","i")),this._weekdaysParse[r]||(o="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(o.replace(".",""),"i")),n&&"dddd"===e&&this._fullWeekdaysParse[r].test(t))return r;if(n&&"ddd"===e&&this._shortWeekdaysParse[r].test(t))return r;if(n&&"dd"===e&&this._minWeekdaysParse[r].test(t))return r;if(!n&&this._weekdaysParse[r].test(t))return r}}function an(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=tn(t,this.localeData()),this.add(t-e,"d")):e}function un(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function sn(t){return this.isValid()?null==t?this.day()||7:this.day(this.day()%7?t:t-7):null!=t?this:NaN}function cn(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function ln(){return this.hours()%12||12}function fn(t,e){G(t,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)})}function dn(t,e){return e._meridiemParse}function hn(t){return"p"===(t+"").toLowerCase().charAt(0)}function pn(t,e,n){return t>11?n?"pm":"PM":n?"am":"AM"}function _n(t,e){e[Nr]=m(1e3*("0."+t))}function vn(){return this._isUTC?"UTC":""}function yn(){return this._isUTC?"Coordinated Universal Time":""}function mn(t){return xt(1e3*t)}function gn(){return xt.apply(null,arguments).parseZone()}function bn(t,e,n){var r=this._calendar[t];return O(r)?r.call(e,n):r}function Sn(t){var e=this._longDateFormat[t],n=this._longDateFormat[t.toUpperCase()];return e||!n?e:(this._longDateFormat[t]=n.replace(/MMMM|MM|DD|dddd/g,function(t){return t.slice(1)}),this._longDateFormat[t])}function wn(){return this._invalidDate}function On(t){return this._ordinal.replace("%d",t)}function Mn(t){return t}function In(t,e,n,r){var i=this._relativeTime[n];return O(i)?i(t,e,n,r):i.replace(/%d/i,t)}function Tn(t,e){var n=this._relativeTime[t>0?"future":"past"];return O(n)?n(e):n.replace(/%s/i,e)}function En(t,e,n,r){var i=L(),o=s().set(r,e);return i[n](o,t)}function Dn(t,e,n,r,i){if("number"==typeof t&&(e=t,t=void 0),t=t||"",null!=e)return En(t,e,n,i);var o,a=[];for(o=0;r>o;o++)a[o]=En(t,o,n,i);return a}function jn(t,e){return Dn(t,e,"months",12,"month")}function Cn(t,e){return Dn(t,e,"monthsShort",12,"month")}function Pn(t,e){return Dn(t,e,"weekdays",7,"day")}function An(t,e){return Dn(t,e,"weekdaysShort",7,"day")}function kn(t,e){return Dn(t,e,"weekdaysMin",7,"day")}function Ln(){var t=this._data;return this._milliseconds=Ii(this._milliseconds),this._days=Ii(this._days),this._months=Ii(this._months),t.milliseconds=Ii(t.milliseconds),t.seconds=Ii(t.seconds),t.minutes=Ii(t.minutes),t.hours=Ii(t.hours),t.months=Ii(t.months),t.years=Ii(t.years),this}function Nn(t,e,n,r){var i=re(e,n);return t._milliseconds+=r*i._milliseconds,t._days+=r*i._days,t._months+=r*i._months,t._bubble()}function xn(t,e){return Nn(this,t,e,1)}function Rn(t,e){return Nn(this,t,e,-1)}function Hn(t){return 0>t?Math.floor(t):Math.ceil(t)}function Yn(){var t,e,n,r,i,o=this._milliseconds,a=this._days,u=this._months,s=this._data;return o>=0&&a>=0&&u>=0||0>=o&&0>=a&&0>=u||(o+=864e5*Hn(Un(u)+a),a=0,u=0),s.milliseconds=o%1e3,t=y(o/1e3),s.seconds=t%60,e=y(t/60),s.minutes=e%60,n=y(e/60),s.hours=n%24,a+=y(n/24),i=y(zn(a)),u+=i,a-=Hn(Un(i)),r=y(u/12),u%=12,s.days=a,s.months=u,s.years=r,this}function zn(t){return 4800*t/146097}function Un(t){return 146097*t/4800}function Vn(t){var e,n,r=this._milliseconds;if(t=R(t),"month"===t||"year"===t)return e=this._days+r/864e5,n=this._months+zn(e),"month"===t?n:n/12;switch(e=this._days+Math.round(Un(this._months)),t){case"week":return e/7+r/6048e5;case"day":return e+r/864e5;case"hour":return 24*e+r/36e5;case"minute":return 1440*e+r/6e4;case"second":return 86400*e+r/1e3;case"millisecond":return Math.floor(864e5*e)+r;default:throw new Error("Unknown unit "+t)}}function Bn(){return this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*m(this._months/12)}function Gn(t){return function(){return this.as(t)}}function Fn(t){return t=R(t),this[t+"s"]()}function Wn(t){return function(){return this._data[t]}}function qn(){return y(this.days()/7)}function Kn(t,e,n,r,i){return i.relativeTime(e||1,!!n,t,r)}function Jn(t,e,n){var r=re(t).abs(),i=Ui(r.as("s")),o=Ui(r.as("m")),a=Ui(r.as("h")),u=Ui(r.as("d")),s=Ui(r.as("M")),c=Ui(r.as("y")),l=i=o&&["m"]||o=a&&["h"]||a=u&&["d"]||u=s&&["M"]||s=c&&["y"]||["yy",c];return l[2]=e,l[3]=+t>0,l[4]=n,Kn.apply(null,l)}function $n(t,e){return void 0===Vi[t]?!1:void 0===e?Vi[t]:(Vi[t]=e,!0)}function Zn(t){var e=this.localeData(),n=Jn(this,!t,e);return t&&(n=e.pastFuture(+this,n)),e.postformat(n)}function Xn(){var t,e,n,r=Bi(this._milliseconds)/1e3,i=Bi(this._days),o=Bi(this._months);t=y(r/60),e=y(t/60),r%=60,t%=60,n=y(o/12),o%=12;var a=n,u=o,s=i,c=e,l=t,f=r,d=this.asSeconds();return d?(0>d?"-":"")+"P"+(a?a+"Y":"")+(u?u+"M":"")+(s?s+"D":"")+(c||l||f?"T":"")+(c?c+"H":"")+(l?l+"M":"")+(f?f+"S":""):"P0D"}var Qn,tr=e.momentProperties=[],er=!1,nr={};e.suppressDeprecationWarnings=!1;var rr,ir={},or={},ar=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ur=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,sr={},cr={},lr=/\d/,fr=/\d\d/,dr=/\d{3}/,hr=/\d{4}/,pr=/[+-]?\d{6}/,_r=/\d\d?/,vr=/\d\d\d\d?/,yr=/\d\d\d\d\d\d?/,mr=/\d{1,3}/,gr=/\d{1,4}/,br=/[+-]?\d{1,6}/,Sr=/\d+/,wr=/[+-]?\d+/,Or=/Z|[+-]\d\d:?\d\d/gi,Mr=/Z|[+-]\d\d(?::?\d\d)?/gi,Ir=/[+-]?\d+(\.\d{1,3})?/,Tr=/[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF\/]+(\s*?[\u0600-\u06FF]+){1,2}/i,Er={},Dr={},jr=0,Cr=1,Pr=2,Ar=3,kr=4,Lr=5,Nr=6,xr=7,Rr=8;G("M",["MM",2],"Mo",function(){return this.month()+1}),G("MMM",0,0,function(t){return this.localeData().monthsShort(this,t)}),G("MMMM",0,0,function(t){return this.localeData().months(this,t)}),x("month","M"),J("M",_r),J("MM",_r,fr),J("MMM",function(t,e){return e.monthsShortRegex(t)}),J("MMMM",function(t,e){return e.monthsRegex(t)}),Q(["M","MM"],function(t,e){e[Cr]=m(t)-1}),Q(["MMM","MMMM"],function(t,e,n,r){var i=n._locale.monthsParse(t,r,n._strict);null!=i?e[Cr]=i:l(n).invalidMonth=t});var Hr=/D[oD]?(\[[^\[\]]*\]|\s+)+MMMM?/,Yr="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),zr="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),Ur=Tr,Vr=Tr,Br=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Gr=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?/,Fr=/Z|[+-]\d\d(?::?\d\d)?/,Wr=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],qr=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Kr=/^\/?Date\((\-?\d+)/i;e.createFromInputFallback=S("moment construction falls back to js Date. This is discouraged and will be removed in upcoming major release. Please refer to https://github.com/moment/moment/issues/1407 for more info.",function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))}),G("Y",0,0,function(){var t=this.year();return 9999>=t?""+t:"+"+t}),G(0,["YY",2],0,function(){return this.year()%100}),G(0,["YYYY",4],0,"year"),G(0,["YYYYY",5],0,"year"),G(0,["YYYYYY",6,!0],0,"year"),x("year","y"),J("Y",wr),J("YY",_r,fr),J("YYYY",gr,hr),J("YYYYY",br,pr),J("YYYYYY",br,pr),Q(["YYYYY","YYYYYY"],jr),Q("YYYY",function(t,n){n[jr]=2===t.length?e.parseTwoDigitYear(t):m(t)}),Q("YY",function(t,n){n[jr]=e.parseTwoDigitYear(t)}),Q("Y",function(t,e){e[jr]=parseInt(t,10)}),e.parseTwoDigitYear=function(t){return m(t)+(m(t)>68?1900:2e3)};var Jr=Y("FullYear",!1);e.ISO_8601=function(){};var $r=S("moment().min is deprecated, use moment.max instead. https://github.com/moment/moment/issues/1548",function(){var t=xt.apply(null,arguments);return this.isValid()&&t.isValid()?this>t?this:t:d()}),Zr=S("moment().max is deprecated, use moment.min instead. https://github.com/moment/moment/issues/1548",function(){var t=xt.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:d()}),Xr=function(){return Date.now?Date.now():+new Date};Vt("Z",":"),Vt("ZZ",""),J("Z",Mr),J("ZZ",Mr),Q(["Z","ZZ"],function(t,e,n){n._useUTC=!0,n._tzm=Bt(Mr,t)});var Qr=/([\+\-]|\d\d)/gi;e.updateOffset=function(){};var ti=/^(\-)?(?:(\d*)[. ])?(\d+)\:(\d+)(?:\:(\d+)\.?(\d{3})?\d*)?$/,ei=/^(-)?P(?:([0-9,.]*)Y)?(?:([0-9,.]*)M)?(?:([0-9,.]*)W)?(?:([0-9,.]*)D)?(?:T(?:([0-9,.]*)H)?(?:([0-9,.]*)M)?(?:([0-9,.]*)S)?)?$/;re.fn=zt.prototype;var ni=se(1,"add"),ri=se(-1,"subtract");e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ";var ii=S("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(t){return void 0===t?this.localeData():this.locale(t)});G(0,["gg",2],0,function(){return this.weekYear()%100}),G(0,["GG",2],0,function(){return this.isoWeekYear()%100}),Ue("gggg","weekYear"),Ue("ggggg","weekYear"),Ue("GGGG","isoWeekYear"),Ue("GGGGG","isoWeekYear"),x("weekYear","gg"),x("isoWeekYear","GG"),J("G",wr),J("g",wr),J("GG",_r,fr),J("gg",_r,fr),J("GGGG",gr,hr),J("gggg",gr,hr),J("GGGGG",br,pr),J("ggggg",br,pr),tt(["gggg","ggggg","GGGG","GGGGG"],function(t,e,n,r){e[r.substr(0,2)]=m(t)}),tt(["gg","GG"],function(t,n,r,i){n[i]=e.parseTwoDigitYear(t)}),G("Q",0,"Qo","quarter"),x("quarter","Q"),J("Q",lr),Q("Q",function(t,e){e[Cr]=3*(m(t)-1)}),G("w",["ww",2],"wo","week"),G("W",["WW",2],"Wo","isoWeek"),x("week","w"),x("isoWeek","W"),J("w",_r),J("ww",_r,fr),J("W",_r),J("WW",_r,fr),tt(["w","ww","W","WW"],function(t,e,n,r){e[r.substr(0,1)]=m(t)});var oi={dow:0,doy:6};G("D",["DD",2],"Do","date"),x("date","D"),J("D",_r),J("DD",_r,fr),J("Do",function(t,e){return t?e._ordinalParse:e._ordinalParseLenient}),Q(["D","DD"],Pr),Q("Do",function(t,e){e[Pr]=m(t.match(_r)[0],10)});var ai=Y("Date",!0);G("d",0,"do","day"),G("dd",0,0,function(t){return this.localeData().weekdaysMin(this,t)}),G("ddd",0,0,function(t){return this.localeData().weekdaysShort(this,t)}),G("dddd",0,0,function(t){return this.localeData().weekdays(this,t)}),G("e",0,0,"weekday"),G("E",0,0,"isoWeekday"),x("day","d"),x("weekday","e"),x("isoWeekday","E"),J("d",_r),J("e",_r),J("E",_r),J("dd",Tr),J("ddd",Tr),J("dddd",Tr),tt(["dd","ddd","dddd"],function(t,e,n,r){var i=n._locale.weekdaysParse(t,r,n._strict);null!=i?e.d=i:l(n).invalidWeekday=t}),tt(["d","e","E"],function(t,e,n,r){e[r]=m(t)});var ui="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),si="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),ci="Su_Mo_Tu_We_Th_Fr_Sa".split("_");G("DDD",["DDDD",3],"DDDo","dayOfYear"),x("dayOfYear","DDD"),J("DDD",mr),J("DDDD",dr),Q(["DDD","DDDD"],function(t,e,n){n._dayOfYear=m(t)}),G("H",["HH",2],0,"hour"),G("h",["hh",2],0,ln),G("hmm",0,0,function(){return""+ln.apply(this)+B(this.minutes(),2)}),G("hmmss",0,0,function(){return""+ln.apply(this)+B(this.minutes(),2)+B(this.seconds(),2)}),G("Hmm",0,0,function(){return""+this.hours()+B(this.minutes(),2)}),G("Hmmss",0,0,function(){return""+this.hours()+B(this.minutes(),2)+B(this.seconds(),2)}),fn("a",!0),fn("A",!1),x("hour","h"),J("a",dn),J("A",dn),J("H",_r),J("h",_r),J("HH",_r,fr),J("hh",_r,fr),J("hmm",vr),J("hmmss",yr),J("Hmm",vr),J("Hmmss",yr),Q(["H","HH"],Ar),Q(["a","A"],function(t,e,n){n._isPm=n._locale.isPM(t),n._meridiem=t}),Q(["h","hh"],function(t,e,n){e[Ar]=m(t),l(n).bigHour=!0}),Q("hmm",function(t,e,n){var r=t.length-2;e[Ar]=m(t.substr(0,r)),e[kr]=m(t.substr(r)),l(n).bigHour=!0}),Q("hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[Ar]=m(t.substr(0,r)),e[kr]=m(t.substr(r,2)),e[Lr]=m(t.substr(i)),l(n).bigHour=!0}),Q("Hmm",function(t,e,n){var r=t.length-2;e[Ar]=m(t.substr(0,r)),e[kr]=m(t.substr(r))}),Q("Hmmss",function(t,e,n){var r=t.length-4,i=t.length-2;e[Ar]=m(t.substr(0,r)),e[kr]=m(t.substr(r,2)),e[Lr]=m(t.substr(i))});var li=/[ap]\.?m?\.?/i,fi=Y("Hours",!0);G("m",["mm",2],0,"minute"),x("minute","m"),J("m",_r),J("mm",_r,fr),Q(["m","mm"],kr);var di=Y("Minutes",!1);G("s",["ss",2],0,"second"),x("second","s"),J("s",_r),J("ss",_r,fr),Q(["s","ss"],Lr);var hi=Y("Seconds",!1);G("S",0,0,function(){return~~(this.millisecond()/100)}),G(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),G(0,["SSS",3],0,"millisecond"),G(0,["SSSS",4],0,function(){return 10*this.millisecond()}),G(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),G(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),G(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),G(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),G(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),x("millisecond","ms"),J("S",mr,lr),J("SS",mr,fr),J("SSS",mr,dr);var pi;for(pi="SSSS";pi.length<=9;pi+="S")J(pi,Sr);for(pi="S";pi.length<=9;pi+="S")Q(pi,_n);var _i=Y("Milliseconds",!1);G("z",0,0,"zoneAbbr"),G("zz",0,0,"zoneName");var vi=_.prototype;vi.add=ni,vi.calendar=le,vi.clone=fe,vi.diff=me,vi.endOf=Ce,vi.format=we,vi.from=Oe,vi.fromNow=Me,vi.to=Ie,vi.toNow=Te,vi.get=V,vi.invalidAt=Ye,vi.isAfter=de,vi.isBefore=he,vi.isBetween=pe,vi.isSame=_e,vi.isSameOrAfter=ve,vi.isSameOrBefore=ye,vi.isValid=Re,vi.lang=ii,vi.locale=Ee,vi.localeData=De,vi.max=Zr,vi.min=$r,vi.parsingFlags=He,vi.set=V,vi.startOf=je,vi.subtract=ri,vi.toArray=Le,vi.toObject=Ne,vi.toDate=ke,vi.toISOString=Se,vi.toJSON=xe,vi.toString=be,vi.unix=Ae,vi.valueOf=Pe,vi.creationData=ze,vi.year=Jr,vi.isLeapYear=gt,vi.weekYear=Ve,vi.isoWeekYear=Be,vi.quarter=vi.quarters=Ke,vi.month=ut,vi.daysInMonth=st,vi.week=vi.weeks=Xe,vi.isoWeek=vi.isoWeeks=Qe,vi.weeksInYear=Fe,vi.isoWeeksInYear=Ge,vi.date=ai,vi.day=vi.days=an,vi.weekday=un,vi.isoWeekday=sn,vi.dayOfYear=cn,vi.hour=vi.hours=fi,vi.minute=vi.minutes=di,vi.second=vi.seconds=hi,vi.millisecond=vi.milliseconds=_i,vi.utcOffset=Wt,vi.utc=Kt,vi.local=Jt,vi.parseZone=$t,vi.hasAlignedHourOffset=Zt,vi.isDST=Xt,vi.isDSTShifted=Qt,vi.isLocal=te,vi.isUtcOffset=ee,vi.isUtc=ne,vi.isUTC=ne,vi.zoneAbbr=vn,vi.zoneName=yn,vi.dates=S("dates accessor is deprecated. Use date instead.",ai),vi.months=S("months accessor is deprecated. Use month instead",ut),vi.years=S("years accessor is deprecated. Use year instead",Jr),vi.zone=S("moment().zone is deprecated, use moment().utcOffset instead. https://github.com/moment/moment/issues/1779",qt);var yi=vi,mi={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},gi={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},bi="Invalid date",Si="%d",wi=/\d{1,2}/,Oi={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},Mi=E.prototype;Mi._calendar=mi,Mi.calendar=bn,Mi._longDateFormat=gi,Mi.longDateFormat=Sn,Mi._invalidDate=bi,Mi.invalidDate=wn,Mi._ordinal=Si,Mi.ordinal=On,Mi._ordinalParse=wi,Mi.preparse=Mn,Mi.postformat=Mn,Mi._relativeTime=Oi,Mi.relativeTime=In,Mi.pastFuture=Tn,Mi.set=I,Mi.months=rt,Mi._months=Yr,Mi.monthsShort=it,Mi._monthsShort=zr,Mi.monthsParse=ot,Mi._monthsRegex=Vr,Mi.monthsRegex=lt,Mi._monthsShortRegex=Ur,Mi.monthsShortRegex=ct,Mi.week=Je,Mi._week=oi,Mi.firstDayOfYear=Ze,Mi.firstDayOfWeek=$e,Mi.weekdays=en,Mi._weekdays=ui,Mi.weekdaysMin=rn,Mi._weekdaysMin=ci,Mi.weekdaysShort=nn,Mi._weekdaysShort=si,Mi.weekdaysParse=on,Mi.isPM=hn,Mi._meridiemParse=li,Mi.meridiem=pn,P("en",{ordinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10,n=1===m(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th";return t+n}}),e.lang=S("moment.lang is deprecated. Use moment.locale instead.",P),e.langData=S("moment.langData is deprecated. Use moment.localeData instead.",L);var Ii=Math.abs,Ti=Gn("ms"),Ei=Gn("s"),Di=Gn("m"),ji=Gn("h"),Ci=Gn("d"),Pi=Gn("w"),Ai=Gn("M"),ki=Gn("y"),Li=Wn("milliseconds"),Ni=Wn("seconds"),xi=Wn("minutes"),Ri=Wn("hours"),Hi=Wn("days"),Yi=Wn("months"),zi=Wn("years"),Ui=Math.round,Vi={s:45,m:45,h:22,d:26,M:11},Bi=Math.abs,Gi=zt.prototype;Gi.abs=Ln,Gi.add=xn,Gi.subtract=Rn,Gi.as=Vn,Gi.asMilliseconds=Ti,Gi.asSeconds=Ei,Gi.asMinutes=Di,Gi.asHours=ji,Gi.asDays=Ci,Gi.asWeeks=Pi,Gi.asMonths=Ai,Gi.asYears=ki,Gi.valueOf=Bn,Gi._bubble=Yn,Gi.get=Fn,Gi.milliseconds=Li,Gi.seconds=Ni,Gi.minutes=xi,Gi.hours=Ri,Gi.days=Hi,Gi.weeks=qn,Gi.months=Yi,Gi.years=zi,Gi.humanize=Zn,Gi.toISOString=Xn,Gi.toString=Xn,Gi.toJSON=Xn,Gi.locale=Ee,Gi.localeData=De,Gi.toIsoString=S("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Xn),Gi.lang=ii,G("X",0,0,"unix"),G("x",0,0,"valueOf"),J("x",wr),J("X",Ir),Q("X",function(t,e,n){n._d=new Date(1e3*parseFloat(t,10))}),Q("x",function(t,e,n){n._d=new Date(m(t))}),e.version="2.12.0",n(xt),e.fn=yi,e.min=Ht,e.max=Yt,e.now=Xr,e.utc=s,e.unix=mn,e.months=jn,e.isDate=i,e.locale=P,e.invalid=d,e.duration=re,e.isMoment=v,e.weekdays=Pn,e.parseZone=gn,e.localeData=L,e.isDuration=Ut,e.monthsShort=Cn,e.weekdaysMin=kn,e.defineLocale=A,e.updateLocale=k,e.locales=N,e.weekdaysShort=An,e.normalizeUnits=R,e.relativeTimeThreshold=$n,e.prototype=yi;var Fi=e;return Fi})}).call(e,n(69)(t))},function(t,e){"use strict";function n(t){if(null===t||void 0===t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}var r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;t.exports=Object.assign||function(t,e){for(var o,a,u=n(t),s=1;s199&&r.status<300?t(e):n(e)},r.onerror=function(){return n({})},o?r.send(JSON.stringify(o)):r.send()})};e["default"]=o},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=arguments.length<=2||void 0===arguments[2]?{}:arguments[2],r=n.useStreaming,i=void 0===r?t.evaluate(c.getters.isSupported):r,o=n.rememberAuth,a=void 0===o?!1:o,s=n.host,d=void 0===s?"":s;t.dispatch(u["default"].VALIDATING_AUTH_TOKEN,{authToken:e,host:d}),l.actions.fetchAll(t).then(function(){t.dispatch(u["default"].VALID_AUTH_TOKEN,{authToken:e,host:d,rememberAuth:a}),i?c.actions.start(t,{syncOnInitialConnect:!1}):l.actions.start(t,{skipInitialSync:!0})},function(){var e=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=e.message,r=void 0===n?f:n;t.dispatch(u["default"].INVALID_AUTH_TOKEN,{errorMessage:r})})}function o(t){(0,s.callApi)(t,"POST","log_out"),t.dispatch(u["default"].LOG_OUT,{})}Object.defineProperty(e,"__esModule",{value:!0}),e.validate=i,e.logOut=o;var a=n(14),u=r(a),s=n(5),c=n(24),l=n(26),f="Unexpected result from API"},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=e.isValidating=["authAttempt","isValidating"],r=(e.isInvalidAttempt=["authAttempt","isInvalid"],e.attemptErrorMessage=["authAttempt","errorMessage"],e.rememberAuth=["rememberAuth"],e.attemptAuthInfo=[["authAttempt","authToken"],["authAttempt","host"],function(t,e){return{authToken:t,host:e}}]),i=e.currentAuthToken=["authCurrent","authToken"],o=e.currentAuthInfo=[i,["authCurrent","host"],function(t,e){return{authToken:t,host:e}}];e.authToken=[n,["authAttempt","authToken"],["authCurrent","authToken"],function(t,e,n){return t?e:n}],e.authInfo=[n,r,o,function(t,e,n){return t?e:n}]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){if(null==t)throw new TypeError("Cannot destructure undefined")}function o(t,e){var n=e.authToken,r=e.host;return(0,s.toImmutable)({authToken:n,host:r,isValidating:!0,isInvalid:!1,errorMessage:""})}function a(t,e){return i(e),f.getInitialState()}function u(t,e){var n=e.errorMessage;return t.withMutations(function(t){return t.set("isValidating",!1).set("isInvalid",!0).set("errorMessage",n)})}Object.defineProperty(e,"__esModule",{value:!0});var s=n(3),c=n(14),l=r(c),f=new s.Store({getInitialState:function(){return(0,s.toImmutable)({isValidating:!1,authToken:!1,host:null,isInvalid:!1,errorMessage:""})},initialize:function(){this.on(l["default"].VALIDATING_AUTH_TOKEN,o),this.on(l["default"].VALID_AUTH_TOKEN,a),this.on(l["default"].INVALID_AUTH_TOKEN,u)}});e["default"]=f},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=e.authToken,r=e.host;return(0,a.toImmutable)({authToken:n,host:r})}function o(){return c.getInitialState()}Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),u=n(14),s=r(u),c=new a.Store({getInitialState:function(){return(0,a.toImmutable)({authToken:null,host:""})},initialize:function(){this.on(s["default"].VALID_AUTH_TOKEN,i),this.on(s["default"].LOG_OUT,o)}});e["default"]=c},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=e.rememberAuth;return n}Object.defineProperty(e,"__esModule",{value:!0});var o=n(3),a=n(14),u=r(a),s=new o.Store({getInitialState:function(){return!0},initialize:function(){this.on(u["default"].VALID_AUTH_TOKEN,i)}});e["default"]=s},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){t.dispatch(c["default"].SERVER_CONFIG_LOADED,e)}function o(t){(0,u.callApi)(t,"GET","config").then(function(e){return i(t,e)})}function a(t,e){t.dispatch(c["default"].COMPONENT_LOADED,{component:e})}Object.defineProperty(e,"__esModule",{value:!0}),e.configLoaded=i,e.fetchAll=o,e.componentLoaded=a;var u=n(5),s=n(18),c=r(s)},function(t,e){"use strict";function n(t){return[["serverComponent"],function(e){return e.contains(t)}]}Object.defineProperty(e,"__esModule",{value:!0}),e.isComponentLoaded=n,e.locationGPS=[["serverConfig","latitude"],["serverConfig","longitude"],function(t,e){return{latitude:t,longitude:e}}],e.locationName=["serverConfig","location_name"],e.serverVersion=["serverConfig","serverVersion"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=e.component;return t.push(n)}function o(t,e){var n=e.components;return(0,u.toImmutable)(n)}function a(){return l.getInitialState()}Object.defineProperty(e,"__esModule",{value:!0});var u=n(3),s=n(18),c=r(s),l=new u.Store({getInitialState:function(){return(0,u.toImmutable)([])},initialize:function(){this.on(c["default"].COMPONENT_LOADED,i),this.on(c["default"].SERVER_CONFIG_LOADED,o),this.on(c["default"].LOG_OUT,a)}});e["default"]=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=e.latitude,r=e.longitude,i=e.location_name,o=e.temperature_unit,u=e.time_zone,s=e.version;return(0,a.toImmutable)({latitude:n,longitude:r,location_name:i,temperature_unit:o,time_zone:u,serverVersion:s})}function o(){return c.getInitialState()}Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),u=n(18),s=r(u),c=new a.Store({getInitialState:function(){return(0,a.toImmutable)({latitude:null,longitude:null,location_name:"Home",temperature_unit:"°C",time_zone:"UTC",serverVersion:"unknown"})},initialize:function(){this.on(s["default"].SERVER_CONFIG_LOADED,i),this.on(s["default"].LOG_OUT,o)}});e["default"]=c},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}function o(t,e){t.dispatch(f["default"].ENTITY_HISTORY_DATE_SELECTED,{date:e})}function a(t){var e=arguments.length<=1||void 0===arguments[1]?null:arguments[1];t.dispatch(f["default"].RECENT_ENTITY_HISTORY_FETCH_START,{});var n="history/period";return null!==e&&(n+="?filter_entity_id="+e),(0,c.callApi)(t,"GET",n).then(function(e){return t.dispatch(f["default"].RECENT_ENTITY_HISTORY_FETCH_SUCCESS,{stateHistory:e})},function(){return t.dispatch(f["default"].RECENT_ENTITY_HISTORY_FETCH_ERROR,{})})}function u(t,e){return t.dispatch(f["default"].ENTITY_HISTORY_FETCH_START,{date:e}),(0,c.callApi)(t,"GET","history/period/"+e).then(function(n){return t.dispatch(f["default"].ENTITY_HISTORY_FETCH_SUCCESS,{date:e,stateHistory:n})},function(){return t.dispatch(f["default"].ENTITY_HISTORY_FETCH_ERROR,{})})}function s(t){var e=t.evaluate(h.currentDate);return u(t,e)}Object.defineProperty(e,"__esModule",{value:!0}),e.changeCurrentDate=o,e.fetchRecent=a,e.fetchDate=u,e.fetchSelectedDate=s;var c=n(5),l=n(11),f=i(l),d=n(38),h=r(d)},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=e.date;return(0,s["default"])(n)}function o(){return f.getInitialState()}Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),u=n(27),s=r(u),c=n(11),l=r(c),f=new a.Store({getInitialState:function(){var t=new Date;return t.setDate(t.getDate()-1),(0,s["default"])(t)},initialize:function(){this.on(l["default"].ENTITY_HISTORY_DATE_SELECTED,i),this.on(l["default"].LOG_OUT,o)}});e["default"]=f},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=e.date,r=e.stateHistory;return 0===r.length?t.set(n,(0,a.toImmutable)({})):t.withMutations(function(t){r.forEach(function(e){return t.setIn([n,e[0].entity_id],(0,a.toImmutable)(e.map(l["default"].fromJSON)))})})}function o(){return f.getInitialState()}Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),u=n(11),s=r(u),c=n(16),l=r(c),f=new a.Store({getInitialState:function(){return(0,a.toImmutable)({})},initialize:function(){this.on(s["default"].ENTITY_HISTORY_FETCH_SUCCESS,i),this.on(s["default"].LOG_OUT,o)}});e["default"]=f},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(3),o=n(11),a=r(o),u=new i.Store({getInitialState:function(){return!1},initialize:function(){this.on(a["default"].ENTITY_HISTORY_FETCH_START,function(){return!0}),this.on(a["default"].ENTITY_HISTORY_FETCH_SUCCESS,function(){return!1}),this.on(a["default"].ENTITY_HISTORY_FETCH_ERROR,function(){return!1}),this.on(a["default"].RECENT_ENTITY_HISTORY_FETCH_START,function(){return!0}),this.on(a["default"].RECENT_ENTITY_HISTORY_FETCH_SUCCESS,function(){ +return!1}),this.on(a["default"].RECENT_ENTITY_HISTORY_FETCH_ERROR,function(){return!1}),this.on(a["default"].LOG_OUT,function(){return!1})}});e["default"]=u},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=e.stateHistory;return t.withMutations(function(t){n.forEach(function(e){return t.set(e[0].entity_id,(0,a.toImmutable)(e.map(l["default"].fromJSON)))})})}function o(){return f.getInitialState()}Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),u=n(11),s=r(u),c=n(16),l=r(c),f=new a.Store({getInitialState:function(){return(0,a.toImmutable)({})},initialize:function(){this.on(s["default"].RECENT_ENTITY_HISTORY_FETCH_SUCCESS,i),this.on(s["default"].LOG_OUT,o)}});e["default"]=f},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){var n=e.stateHistory,r=(new Date).getTime();return t.withMutations(function(t){n.forEach(function(e){return t.set(e[0].entity_id,r)}),history.length>1&&t.set(c,r)})}function o(){return l.getInitialState()}Object.defineProperty(e,"__esModule",{value:!0});var a=n(3),u=n(11),s=r(u),c="ALL_ENTRY_FETCH",l=new a.Store({getInitialState:function(){return(0,a.toImmutable)({})},initialize:function(){this.on(s["default"].RECENT_ENTITY_HISTORY_FETCH_SUCCESS,i),this.on(s["default"].LOG_OUT,o)}});e["default"]=l},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(10),o=n(16),a=r(o),u=(0,i.createApiActions)(a["default"]);e["default"]=u},function(t,e){"use strict";function n(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(e,"__esModule",{value:!0});var r=function(){function t(t,e){for(var n=0;no}Object.defineProperty(e,"__esModule",{value:!0}),e.isLoadingEntries=e.currentEntries=e.isCurrentStale=e.currentDate=void 0;var i=n(3),o=6e4,a=e.currentDate=["currentLogbookDate"];e.isCurrentStale=[a,["logbookEntriesUpdated"],function(t,e){return r(e.get(t))}],e.currentEntries=[a,["logbookEntries"],function(t,e){return e.get(t)||(0,i.toImmutable)([])}],e.isLoadingEntries=["isLoadingLogbookEntries"]},function(t,e,n){"use strict";function r(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e["default"]=t,e}function i(t){return t&&t.__esModule?t:{"default":t}}function o(t){t.registerStores({currentLogbookDate:u["default"],isLoadingLogbookEntries:c["default"],logbookEntries:f["default"],logbookEntriesUpdated:h["default"]})}Object.defineProperty(e,"__esModule",{value:!0}),e.getters=e.actions=void 0,e.register=o;var a=n(98),u=i(a),s=n(99),c=i(s),l=n(100),f=i(l),d=n(101),h=i(d),p=n(94),_=r(p),v=n(95),y=r(v);e.actions=_,e.getters=y},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function a(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}Object.defineProperty(e,"__esModule",{value:!0});var u=function(){function t(t,e){for(var n=0;n1}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(56),e["default"]=new o["default"]({is:"ha-introduction-card",properties:{showInstallInstruction:{type:Boolean,value:!1},showHideInstruction:{type:Boolean,value:!0}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(205),o=r(i),a=n(1),u=r(a),s=n(2),c=r(s),l=c["default"].moreInfoActions;e["default"]=new u["default"]({is:"ha-media_player-card",properties:{stateObj:{type:Object},playerObj:{type:Object,computed:"computePlayerObj(stateObj)",observer:"playerObjChanged"},playbackControlIcon:{type:String,computed:"computePlaybackControlIcon(playerObj)"},elevation:{type:Number,value:1,reflectToAttribute:!0}},playerObjChanged:function(t){t.isOff||t.isIdle||(this.$.cover.style.backgroundImage=t.stateObj.attributes.entity_picture?"url("+t.stateObj.attributes.entity_picture+")":"")},computeBannerClasses:function(t){return(0,o["default"])({banner:!0,"is-off":t.isOff||t.isIdle})},computeHidePowerOnButton:function(t){return!t.isOff||!t.supportsTurnOn},computePlayerObj:function(t){return t.domainModel(c["default"])},computePlaybackControlIcon:function(t){return t.isPlaying?t.supportsPause?"mdi:pause":"mdi:stop":t.isPaused||t.isOff?"mdi:play":""},computeShowControls:function(t){return!t.isOff},handleNext:function(t){t.stopPropagation(),this.playerObj.nextTrack()},handleOpenMoreInfo:function(t){var e=this;t.stopPropagation(),this.async(function(){return l.selectEntity(e.stateObj.entityId)},1)},handlePlaybackControl:function(t){t.stopPropagation(),this.playerObj.mediaPlayPause()},handlePrevious:function(t){t.stopPropagation(),this.playerObj.previousTrack()},handleTogglePower:function(t){t.stopPropagation(),this.playerObj.togglePower()}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(61),u=r(a);e["default"]=new o["default"]({is:"display-time",properties:{dateObj:{type:Object}},computeTime:function(t){return t?(0,u["default"])(t):""}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s),l=o["default"].entityGetters;e["default"]=new u["default"]({is:"entity-list",behaviors:[c["default"]],properties:{entities:{type:Array,bindNuclear:[l.entityMap,function(t){return t.valueSeq().sortBy(function(t){return t.entityId}).toArray()}]}},entitySelected:function(t){t.preventDefault(),this.fire("entity-selected",{entityId:t.model.entity.entityId})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a);n(30);var s=u["default"].reactor,c=u["default"].entityGetters,l=u["default"].moreInfoActions;e["default"]=new o["default"]({is:"ha-entity-marker",properties:{entityId:{type:String,value:""},state:{type:Object,computed:"computeState(entityId)"},icon:{type:Object,computed:"computeIcon(state)"},image:{type:Object,computed:"computeImage(state)"},value:{type:String,computed:"computeValue(state)"}},listeners:{tap:"badgeTap"},badgeTap:function(t){var e=this;t.stopPropagation(),this.entityId&&this.async(function(){return l.selectEntity(e.entityId)},1)},computeState:function(t){return t&&s.evaluate(c.byId(t))},computeIcon:function(t){return!t&&"home"},computeImage:function(t){return t&&t.attributes.entity_picture},computeValue:function(t){return t&&t.entityDisplay.split(" ").map(function(t){return t.substr(0,1)}).join("")}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(63),u=r(a);e["default"]=new o["default"]({is:"ha-state-icon",properties:{stateObj:{type:Object}},computeIcon:function(t){return(0,u["default"])(t)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a),s=n(35),c=r(s),l=n(34),f=r(l),d=n(63),h=r(d);n(30);var p=u["default"].moreInfoActions,_=u["default"].serviceActions;e["default"]=new o["default"]({is:"ha-state-label-badge",properties:{state:{type:Object,observer:"stateChanged"}},listeners:{tap:"badgeTap"},badgeTap:function(t){var e=this;return t.stopPropagation(),(0,f["default"])(this.state.entityId)?void("scene"===this.state.domain||"off"===this.state.state?_.callTurnOn(this.state.entityId):_.callTurnOff(this.state.entityId)):void this.async(function(){return p.selectEntity(e.state.entityId)},1)},computeClasses:function(t){switch(t.domain){case"scene":return"green";case"binary_sensor":case"script":return"on"===t.state?"blue":"grey";case"updater":return"blue";default:return""}},computeValue:function(t){switch(t.domain){case"binary_sensor":case"device_tracker":case"updater":case"sun":case"scene":case"script":case"alarm_control_panel":return null;case"sensor":default:return"unknown"===t.state?"-":t.state}},computeIcon:function(t){switch(t.domain){case"alarm_control_panel":return"pending"===t.state?"mdi:clock-fast":"armed_away"===t.state?"mdi:nature":"armed_home"===t.state?"mdi:home-variant":(0,c["default"])(t.domain,t.state);case"binary_sensor":case"device_tracker":case"scene":case"updater":case"script":return(0,h["default"])(t);case"sun":return"above_horizon"===t.state?(0,c["default"])(t.domain):"mdi:brightness-3";default:return null}},computeImage:function(t){return t.attributes.entity_picture||null},computeLabel:function(t){switch(t.domain){case"scene":case"script":return t.domain;case"device_tracker":return"not_home"===t.state?"Away":t.state;case"alarm_control_panel":return"pending"===t.state?"pend":"armed_away"===t.state||"armed_home"===t.state?"armed":"disarm";default:return t.attributes.unit_of_measurement||null}},computeDescription:function(t){return t.entityDisplay},stateChanged:function(){this.updateStyles()}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(150),e["default"]=new o["default"]({is:"state-badge",properties:{stateObj:{type:Object,observer:"updateIconColor"}},updateIconColor:function(t){return t.attributes.entity_picture?(this.style.backgroundImage="url("+t.attributes.entity_picture+")",void(this.$.icon.style.display="none")):(this.style.backgroundImage="",this.$.icon.style.display="inline",void("light"===t.domain&&"on"===t.state&&t.attributes.rgb_color&&t.attributes.rgb_color.reduce(function(t,e){return t+e},0)<730?this.$.icon.style.color="rgb("+t.attributes.rgb_color.join(",")+")":this.$.icon.style.color=null))}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s),l=o["default"].eventGetters;e["default"]=new u["default"]({is:"events-list",behaviors:[c["default"]],properties:{events:{type:Array,bindNuclear:[l.entityMap,function(t){return t.valueSeq().sortBy(function(t){return t.event}).toArray()}]}},eventSelected:function(t){t.preventDefault(),this.fire("event-selected",{eventType:t.model.event.event})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){return t in d?d[t]:30}function o(t){return"group"===t.domain?t.attributes.order:t.entityDisplay.toLowerCase()}Object.defineProperty(e,"__esModule",{value:!0});var a=n(1),u=r(a),s=n(2),c=r(s);n(156),n(141),n(143);var l=c["default"].util,f={camera:4,media_player:3},d={configurator:-20,group:-10,a:-1,updater:0,sun:1,device_tracker:2,alarm_control_panel:3,sensor:5,binary_sensor:6,scene:7,script:8};e["default"]=new u["default"]({is:"ha-cards",properties:{showIntroduction:{type:Boolean,value:!1},columns:{type:Number,value:2},states:{type:Object},cards:{type:Object}},observers:["updateCards(columns, states, showIntroduction)"],updateCards:function(t,e,n){var r=this;this.debounce("updateCards",function(){r.cards=r.computeCards(t,e,n)},0)},computeCards:function(t,e,n){function r(t){return t.filter(function(t){return!(t.entityId in c)})}function a(t){for(var e=0,n=e;n1;var u=a(o);i.length>0&&(d._columns[u].push(t),d[t]={cardType:"entities",states:i,groupEntity:n}),r.forEach(function(t){d._columns[u].push(t.entityId),d[t.entityId]={cardType:t.domain,stateObj:t}})}}for(var s=e.groupBy(function(t){return t.domain}),c={},d={_demo:!1,_badges:[],_columns:[]},h=[],p=0;t>p;p++)d._columns.push([]),h.push(0);return n&&(d._columns[a(5)].push("ha-introduction"),d["ha-introduction"]={cardType:"introduction",showHideInstruction:e.size>0&&!0}),s.keySeq().sortBy(function(t){return i(t)}).forEach(function(t){if("a"===t)return void(d._demo=!0);var n=i(t);n>=0&&10>n?d._badges.push.apply(d._badges,r(s.get(t)).sortBy(o).toArray()):"group"===t?s.get(t).sortBy(o).forEach(function(t){var n=l.expandGroup(t,e);n.forEach(function(t){c[t.entityId]=!0}),u(t.entityId,n.toArray(),t)}):u(t,r(s.get(t)).sortBy(o).toArray())}),d._columns=d._columns.filter(function(t){return t.length>0}),d},computeCardDataOfCard:function(t,e){return t[e]}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);e["default"]=new o["default"]({is:"ha-color-picker",properties:{color:{type:Object},width:{type:Number},height:{type:Number}},listeners:{mousedown:"onMouseDown",mouseup:"onMouseUp",touchstart:"onTouchStart",touchend:"onTouchEnd"},onMouseDown:function(t){this.onMouseMove(t),this.addEventListener("mousemove",this.onMouseMove)},onMouseUp:function(){this.removeEventListener("mousemove",this.onMouseMove)},onTouchStart:function(t){this.onTouchMove(t),this.addEventListener("touchmove",this.onTouchMove)},onTouchEnd:function(){this.removeEventListener("touchmove",this.onTouchMove)},onTouchMove:function(t){var e=this;this.mouseMoveIsThrottled&&(this.mouseMoveIsThrottled=!1,this.processColorSelect(t.touches[0]),this.async(function(){e.mouseMoveIsThrottled=!0},100))},onMouseMove:function(t){var e=this;this.mouseMoveIsThrottled&&(this.mouseMoveIsThrottled=!1,this.processColorSelect(t),this.async(function(){e.mouseMoveIsThrottled=!0},100))},processColorSelect:function(t){var e=this.canvas.getBoundingClientRect();t.clientX=e.left+e.width||t.clientY=e.top+e.height||this.onColorSelect(t.clientX-e.left,t.clientY-e.top)},onColorSelect:function(t,e){var n=this.context.getImageData(t,e,1,1).data;this.setColor({r:n[0],g:n[1],b:n[2]})},setColor:function(t){this.color=t,this.fire("colorselected",{rgb:this.color})},ready:function(){this.setColor=this.setColor.bind(this),this.mouseMoveIsThrottled=!0,this.canvas=this.children[0],this.context=this.canvas.getContext("2d"),this.drawGradient()},drawGradient:function(){var t=void 0;this.width&&this.height||(t=getComputedStyle(this));var e=this.width||parseInt(t.width,10),n=this.height||parseInt(t.height,10),r=this.context.createLinearGradient(0,0,e,0);r.addColorStop(0,"rgb(255,0,0)"),r.addColorStop(.16,"rgb(255,0,255)"),r.addColorStop(.32,"rgb(0,0,255)"),r.addColorStop(.48,"rgb(0,255,255)"),r.addColorStop(.64,"rgb(0,255,0)"),r.addColorStop(.8,"rgb(255,255,0)"),r.addColorStop(1,"rgb(255,0,0)"),this.context.fillStyle=r,this.context.fillRect(0,0,e,n);var i=this.context.createLinearGradient(0,0,0,n);i.addColorStop(0,"rgba(255,255,255,1)"),i.addColorStop(.5,"rgba(255,255,255,0)"),i.addColorStop(.5,"rgba(0,0,0,0)"),i.addColorStop(1,"rgba(0,0,0,1)"),this.context.fillStyle=i,this.context.fillRect(0,0,e,n)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(30),e["default"]=new o["default"]({is:"ha-demo-badge"})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(159),e["default"]=new o["default"]({is:"ha-logbook",properties:{entries:{type:Object,value:[]}},noEntries:function(t){return!t.length}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(163);var l=o["default"].configGetters,f=o["default"].navigationGetters,d=o["default"].authActions,h=o["default"].navigationActions;e["default"]=new u["default"]({is:"ha-sidebar",behaviors:[c["default"]],properties:{menuShown:{type:Boolean},menuSelected:{type:String},narrow:{type:Boolean},selected:{type:String,bindNuclear:f.activePane},hasHistoryComponent:{type:Boolean,bindNuclear:l.isComponentLoaded("history")},hasLogbookComponent:{type:Boolean,bindNuclear:l.isComponentLoaded("logbook")}},menuSelect:function(){var t=this;this.debounce("updateStyles",function(){return t.updateStyles()},1)},menuClicked:function(t){for(var e=t.target,n=5;n&&!e.getAttribute("data-panel");)e=e.parentElement,n--;n&&this.selectPanel(e.getAttribute("data-panel"))},toggleMenu:function(){this.fire("close-menu")},selectPanel:function(t){var e=this;if(t!==this.selected){if("logout"===t)return void this.handleLogOut();h.navigate.apply(null,t.split("/")),this.debounce("updateStyles",function(){return e.updateStyles()},1)}},handleLogOut:function(){d.logOut()}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a);n(55),n(147),n(57);var s=o["default"].moreInfoActions;e["default"]=new u["default"]({is:"logbook-entry",entityClicked:function(t){t.preventDefault(),s.selectEntity(this.entryObj.entityId)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(55);var l=o["default"].serviceGetters;e["default"]=new u["default"]({is:"services-list",behaviors:[c["default"]],properties:{serviceDomains:{type:Array,bindNuclear:l.entityMap}},computeDomains:function(t){return t.valueSeq().map(function(t){return t.domain}).sort().toJS()},computeServices:function(t,e){return t.get(e).get("services").keySeq().toArray()},serviceClicked:function(t){t.preventDefault(),this.fire("service-selected",{domain:t.model.domain,service:t.model.service})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){var e=parseFloat(t);return!isNaN(e)&&isFinite(e)?e:null}Object.defineProperty(e,"__esModule",{value:!0});var o=n(220),a=r(o),u=n(1),s=r(u);e["default"]=new s["default"]({is:"state-history-chart-line",properties:{data:{type:Object,observer:"dataChanged"},unit:{type:String},isSingleDevice:{type:Boolean,value:!1},isAttached:{type:Boolean,value:!1,observer:"dataChanged"},chartEngine:{type:Object}},created:function(){this.style.display="block"},attached:function(){this.isAttached=!0},dataChanged:function(){this.drawChart()},drawChart:function(){if(this.isAttached){this.chartEngine||(this.chartEngine=new window.google.visualization.LineChart(this));var t=this.unit,e=this.data;if(0!==e.length){var n={legend:{position:"top"},interpolateNulls:!0,titlePosition:"none",vAxes:{0:{title:t}},hAxis:{format:"H:mm"},chartArea:{left:"60",width:"95%"},explorer:{actions:["dragToZoom","rightClickToReset","dragToPan"],keepInBounds:!0,axis:"horizontal",maxZoomIn:.1}};this.isSingleDevice&&(n.legend.position="none",n.vAxes[0].title=null,n.chartArea.left=40,n.chartArea.height="80%",n.chartArea.top=5,n.enableInteractivity=!1);var r=new Date(Math.min.apply(null,e.map(function(t){return t[0].lastChangedAsDate}))),o=new Date(r);o.setDate(o.getDate()+1),o>new Date&&(o=new Date);var u=e.map(function(t){function e(t,e){c&&e&&s.push([t[0]].concat(c.slice(1).map(function(t,n){return e[n]?t:null}))),s.push(t),c=t}var n=t[t.length-1],r=n.domain,a=n.entityDisplay,u=new window.google.visualization.DataTable;u.addColumn({type:"datetime",id:"Time"});var s=[],c=void 0;if("thermostat"===r){var l=t.reduce(function(t,e){return t||e.attributes.target_temp_high!==e.attributes.target_temp_low},!1);u.addColumn("number",a+" current temperature");var f=void 0;l?!function(){u.addColumn("number",a+" target temperature high"),u.addColumn("number",a+" target temperature low");var t=[!1,!0,!0];f=function(n){var r=i(n.attributes.current_temperature),o=i(n.attributes.target_temp_high),a=i(n.attributes.target_temp_low);e([n.lastUpdatedAsDate,r,o,a],t)}}():!function(){u.addColumn("number",a+" target temperature");var t=[!1,!0];f=function(n){var r=i(n.attributes.current_temperature),o=i(n.attributes.temperature);e([n.lastUpdatedAsDate,r,o],t)}}(),t.forEach(f)}else!function(){u.addColumn("number",a);var n="sensor"!==r&&[!0];t.forEach(function(t){var r=i(t.state);e([t.lastChangedAsDate,r],n)})}();return e([o].concat(c.slice(1)),!1),u.addRows(s),u}),s=void 0;s=1===u.length?u[0]:u.slice(1).reduce(function(t,e){return window.google.visualization.data.join(t,e,"full",[[0,0]],(0,a["default"])(1,t.getNumberOfColumns()),(0,a["default"])(1,e.getNumberOfColumns()))},u[0]),this.chartEngine.draw(s,n)}}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);e["default"]=new o["default"]({is:"state-history-chart-timeline",properties:{data:{type:Object,observer:"dataChanged"},isAttached:{type:Boolean,value:!1,observer:"dataChanged"}},attached:function(){this.isAttached=!0},dataChanged:function(){this.drawChart()},drawChart:function(){function t(t,e,n,r){var o=e.replace(/_/g," ");i.addRow([t,o,n,r])}if(this.isAttached){for(var e=o["default"].dom(this),n=this.data;e.node.lastChild;)e.node.removeChild(e.node.lastChild);if(n&&0!==n.length){var r=new window.google.visualization.Timeline(this),i=new window.google.visualization.DataTable;i.addColumn({type:"string",id:"Entity"}),i.addColumn({type:"string",id:"State"}),i.addColumn({type:"date",id:"Start"}),i.addColumn({type:"date",id:"End"});var a=new Date(n.reduce(function(t,e){return Math.min(t,e[0].lastChangedAsDate)},new Date)),u=new Date(a);u.setDate(u.getDate()+1),u>new Date&&(u=new Date);var s=0;n.forEach(function(e){if(0!==e.length){var n=e[0].entityDisplay,r=void 0,i=null,o=null;e.forEach(function(e){null!==i&&e.state!==i?(r=e.lastChangedAsDate,t(n,i,o,r),i=e.state,o=r):null===i&&(i=e.state,o=e.lastChangedAsDate)}),t(n,i,o,u),s++}}),r.draw(i,{height:55+42*s,timeline:{showRowLabels:n.length>1},hAxis:{format:"H:mm"}})}}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s),l=o["default"].streamGetters,f=o["default"].streamActions;e["default"]=new u["default"]({is:"stream-status",behaviors:[c["default"]],properties:{isStreaming:{type:Boolean,bindNuclear:l.isStreamingEvents},hasError:{type:Boolean,bindNuclear:l.hasStreamingEventsError}},toggleChanged:function(){this.isStreaming?f.stop():f.start()}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s),l=o["default"].voiceActions,f=o["default"].voiceGetters;e["default"]=new u["default"]({is:"ha-voice-command-dialog",behaviors:[c["default"]],properties:{dialogOpen:{type:Boolean,value:!1,observer:"dialogOpenChanged"},finalTranscript:{type:String,bindNuclear:f.finalTranscript},interimTranscript:{type:String,bindNuclear:f.extraInterimTranscript},isTransmitting:{type:Boolean,bindNuclear:f.isTransmitting},isListening:{type:Boolean,bindNuclear:f.isListening},showListenInterface:{type:Boolean,computed:"computeShowListenInterface(isListening, isTransmitting)",observer:"showListenInterfaceChanged"}},computeShowListenInterface:function(t,e){return t||e},dialogOpenChanged:function(t){!t&&this.isListening&&l.stop()},showListenInterfaceChanged:function(t){!t&&this.dialogOpen?this.dialogOpen=!1:t&&(this.dialogOpen=!0)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(32),n(58),n(181);var l=o["default"].configGetters,f=o["default"].entityHistoryGetters,d=o["default"].entityHistoryActions,h=o["default"].moreInfoGetters,p=o["default"].moreInfoActions,_=["camera","configurator","scene"];e["default"]=new u["default"]({is:"more-info-dialog",behaviors:[c["default"]],properties:{stateObj:{type:Object,bindNuclear:h.currentEntity,observer:"stateObjChanged"},stateHistory:{type:Object,bindNuclear:[h.currentEntityHistory,function(t){return t?[t]:!1}]},isLoadingHistoryData:{type:Boolean,computed:"computeIsLoadingHistoryData(_delayedDialogOpen, _isLoadingHistoryData)"},_isLoadingHistoryData:{type:Boolean,bindNuclear:f.isLoadingEntityHistory},hasHistoryComponent:{type:Boolean,bindNuclear:l.isComponentLoaded("history"),observer:"fetchHistoryData"},shouldFetchHistory:{type:Boolean,bindNuclear:h.isCurrentEntityHistoryStale,observer:"fetchHistoryData"},showHistoryComponent:{type:Boolean,value:!1,computed:"computeShowHistoryComponent(hasHistoryComponent, stateObj)"},dialogOpen:{type:Boolean,value:!1,observer:"dialogOpenChanged"},_delayedDialogOpen:{type:Boolean,value:!1}},computeIsLoadingHistoryData:function(t,e){return!t||e},computeShowHistoryComponent:function(t,e){return this.hasHistoryComponent&&e&&-1===_.indexOf(e.domain)},fetchHistoryData:function(){this.stateObj&&this.hasHistoryComponent&&this.shouldFetchHistory&&d.fetchRecent(this.stateObj.entityId)},stateObjChanged:function(t){var e=this;return t?void this.async(function(){e.fetchHistoryData(),e.dialogOpen=!0},10):void(this.dialogOpen=!1)},dialogOpenChanged:function(t){var e=this;t?this.async(function(){e._delayedDialogOpen=!0},10):!t&&this.stateObj&&(this.async(function(){return p.deselectEntity()},10),this._delayedDialogOpen=!1)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a),s=n(4),c=r(s),l=n(62),f=r(l);n(158),n(168),n(175),n(174),n(176),n(169),n(170),n(172),n(173),n(171),n(177),n(165),n(164);var d=u["default"].navigationActions,h=u["default"].navigationGetters,p=u["default"].startUrlSync,_=u["default"].stopUrlSync;e["default"]=new o["default"]({is:"home-assistant-main",behaviors:[c["default"]],properties:{narrow:{type:Boolean,value:!1},activePane:{type:String,bindNuclear:h.activePane,observer:"activePaneChanged"},isSelectedStates:{type:Boolean,bindNuclear:h.isActivePane("states")},isSelectedHistory:{type:Boolean,bindNuclear:h.isActivePane("history")},isSelectedMap:{type:Boolean,bindNuclear:h.isActivePane("map")},isSelectedLogbook:{type:Boolean,bindNuclear:h.isActivePane("logbook")},isSelectedDevEvent:{type:Boolean,bindNuclear:h.isActivePane("devEvent")},isSelectedDevState:{type:Boolean,bindNuclear:h.isActivePane("devState")},isSelectedDevTemplate:{type:Boolean,bindNuclear:h.isActivePane("devTemplate")},isSelectedDevService:{type:Boolean,bindNuclear:h.isActivePane("devService")},isSelectedDevInfo:{type:Boolean,bindNuclear:h.isActivePane("devInfo")},showSidebar:{type:Boolean,bindNuclear:h.showSidebar}},listeners:{"open-menu":"openMenu","close-menu":"closeMenu"},openMenu:function(){this.narrow?this.$.drawer.openDrawer():d.showSidebar(!0)},closeMenu:function(){this.$.drawer.closeDrawer(),this.showSidebar&&d.showSidebar(!1)},activePaneChanged:function(){this.narrow&&this.$.drawer.closeDrawer()},attached:function(){(0,f["default"])(),p()},computeForceNarrow:function(t,e){return t||!e},detached:function(){_()}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a),s=n(4),c=r(s),l=n(64),f=r(l),d=n(62),h=r(d),p=u["default"].authGetters;e["default"]=new o["default"]({is:"login-form",behaviors:[c["default"]],properties:{errorMessage:{type:String,bindNuclear:p.attemptErrorMessage},isInvalid:{type:Boolean,bindNuclear:p.isInvalidAttempt},isValidating:{type:Boolean,observer:"isValidatingChanged",bindNuclear:p.isValidating},loadingResources:{type:Boolean,value:!1},forceShowLoading:{type:Boolean,value:!1},showLoading:{type:Boolean,computed:"computeShowSpinner(forceShowLoading, isValidating)"}},listeners:{keydown:"passwordKeyDown","loginButton.tap":"validatePassword"},observers:["validatingChanged(isValidating, isInvalid)"],attached:function(){(0,h["default"])()},computeShowSpinner:function(t,e){return t||e},validatingChanged:function(t,e){t||e||(this.$.passwordInput.value="")},isValidatingChanged:function(t){var e=this;t||this.async(function(){return e.$.passwordInput.focus()},10)},passwordKeyDown:function(t){13===t.keyCode?(this.validatePassword(),t.preventDefault()):this.isInvalid&&(this.isInvalid=!1)},validatePassword:function(){this.$.hideKeyboardOnFocus.focus(),(0,f["default"])(this.$.passwordInput.value,this.$.rememberLogin.checked)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(9),n(154);var l=o["default"].configGetters,f=o["default"].viewActions,d=o["default"].viewGetters,h=o["default"].voiceGetters,p=o["default"].streamGetters,_=o["default"].syncGetters,v=o["default"].syncActions,y=o["default"].voiceActions;e["default"]=new u["default"]({is:"partial-cards",behaviors:[c["default"]],properties:{narrow:{type:Boolean,value:!1},isFetching:{type:Boolean,bindNuclear:_.isFetching},isStreaming:{type:Boolean,bindNuclear:p.isStreamingEvents},canListen:{ +type:Boolean,bindNuclear:[h.isVoiceSupported,l.isComponentLoaded("conversation"),function(t,e){return t&&e}]},introductionLoaded:{type:Boolean,bindNuclear:l.isComponentLoaded("introduction")},locationName:{type:String,bindNuclear:l.locationName},showMenu:{type:Boolean,value:!1,observer:"windowChange"},currentView:{type:String,bindNuclear:[d.currentView,function(t){return t||""}],observer:"removeFocus"},views:{type:Array,bindNuclear:[d.views,function(t){return t.valueSeq().sortBy(function(t){return t.attributes.order}).toArray()}]},hasViews:{type:Boolean,computed:"computeHasViews(views)"},states:{type:Object,bindNuclear:d.currentViewEntities},columns:{type:Number,value:1}},created:function(){var t=this;this.windowChange=this.windowChange.bind(this);for(var e=[],n=0;5>n;n++)e.push(300+300*n);this.mqls=e.map(function(e){var n=window.matchMedia("(min-width: "+e+"px)");return n.addListener(t.windowChange),n})},detached:function(){var t=this;this.mqls.forEach(function(e){return e.removeListener(t.windowChange)})},windowChange:function(){var t=this.mqls.reduce(function(t,e){return t+e.matches},0);this.columns=Math.max(1,t-(!this.narrow&&this.showMenu))},removeFocus:function(){document.activeElement&&document.activeElement.blur()},handleRefresh:function(){v.fetchAll()},handleListenClick:function(){y.listen()},computeMenuButtonClass:function(t,e){return!t&&e?"invisible":""},computeRefreshButtonClass:function(t){return t?"ha-spin":""},computeShowIntroduction:function(t,e,n){return""===t&&(e||0===n.size)},computeHasViews:function(t){return t.length>0},toggleMenu:function(){this.fire("open-menu")},viewSelected:function(t){var e=t.detail.item.getAttribute("data-entity")||null,n=this.currentView||null;e!==n&&this.async(function(){return f.selectView(e)},0)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a);n(9),n(160);var s=o["default"].reactor,c=o["default"].serviceActions,l=o["default"].serviceGetters;e["default"]=new u["default"]({is:"partial-dev-call-service",properties:{narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,value:!1},domain:{type:String,value:""},service:{type:String,value:""},serviceData:{type:String,value:""},description:{type:String,computed:"computeDescription(domain, service)"}},computeDescription:function(t,e){return s.evaluate([l.entityMap,function(n){return n.has(t)&&n.get(t).get("services").has(e)?JSON.stringify(n.get(t).get("services").get(e).toJS(),null,2):"No description available"}])},serviceSelected:function(t){this.domain=t.detail.domain,this.service=t.detail.service},callService:function(){var t=void 0;try{t=this.serviceData?JSON.parse(this.serviceData):{}}catch(e){return void alert("Error parsing JSON: "+e)}c.callService(this.domain,this.service,t)},computeFormClasses:function(t){return"content fit "+(t?"":"layout horizontal")}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a);n(9),n(153);var s=o["default"].eventActions;e["default"]=new u["default"]({is:"partial-dev-fire-event",properties:{narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,value:!1},eventType:{type:String,value:""},eventData:{type:String,value:""}},eventSelected:function(t){this.eventType=t.detail.eventType},fireEvent:function(){var t=void 0;try{t=this.eventData?JSON.parse(this.eventData):{}}catch(e){return void alert("Error parsing JSON: "+e)}s.fireEvent(this.eventType,t)},computeFormClasses:function(t){return"content fit "+(t?"":"layout horizontal")}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(9);var l=o["default"].configGetters,f=o["default"].errorLogActions;e["default"]=new u["default"]({is:"partial-dev-info",behaviors:[c["default"]],properties:{narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,value:!1},hassVersion:{type:String,bindNuclear:l.serverVersion},polymerVersion:{type:String,value:u["default"].version},nuclearVersion:{type:String,value:"1.3.0"},errorLog:{type:String,value:""}},attached:function(){this.refreshErrorLog()},refreshErrorLog:function(t){var e=this;t&&t.preventDefault(),this.errorLog="Loading error log…",f.fetchErrorLog().then(function(t){e.errorLog=t||"No errors have been reported."})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a);n(9),n(148);var s=o["default"].reactor,c=o["default"].entityGetters,l=o["default"].entityActions;e["default"]=new u["default"]({is:"partial-dev-set-state",properties:{narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,value:!1},entityId:{type:String,value:""},state:{type:String,value:""},stateAttributes:{type:String,value:""}},setStateData:function(t){var e=t?JSON.stringify(t,null," "):"";this.$.inputData.value=e,this.$.inputDataWrapper.update(this.$.inputData)},entitySelected:function(t){var e=s.evaluate(c.byId(t.detail.entityId));this.entityId=e.entityId,this.state=e.state,this.stateAttributes=JSON.stringify(e.attributes,null," ")},handleSetState:function(){var t=void 0;try{t=this.stateAttributes?JSON.parse(this.stateAttributes):{}}catch(e){return void alert("Error parsing JSON: "+e)}l.save({entityId:this.entityId,state:this.state,attributes:t})},computeFormClasses:function(t){return"content fit "+(t?"":"layout horizontal")}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(9);var l=o["default"].templateActions;e["default"]=new u["default"]({is:"partial-dev-template",behaviors:[c["default"]],properties:{narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,value:!1},error:{type:Boolean,value:!1},rendering:{type:Boolean,value:!1},template:{type:String,value:'{%- if is_state("device_tracker.paulus", "home") and \n is_state("device_tracker.anne_therese", "home") -%}\n\n You are both home, you silly\n\n{%- else -%}\n\n Anne Therese is at {{ states("device_tracker.anne_therese") }} and Paulus is at {{ states("device_tracker.paulus") }}\n\n{%- endif %}\n\nFor loop example:\n\n{% for state in states.sensor -%}\n {%- if loop.first %}The {% elif loop.last %} and the {% else %}, the {% endif -%}\n {{ state.name | lower }} is {{state.state}} {{- state.attributes.unit_of_measurement}}\n{%- endfor -%}.',observer:"templateChanged"},processed:{type:String,value:""}},computeFormClasses:function(t){return"content fit "+(t?"":"layout horizontal")},computeRenderedClasses:function(t){return t?"error rendered":"rendered"},templateChanged:function(){this.error&&(this.error=!1),this.debounce("render-template",this.renderTemplate,500)},renderTemplate:function(){var t=this;this.rendering=!0,l.render(this.template).then(function(e){t.processed=e,t.rendering=!1},function(e){t.processed=e.message,t.error=!0,t.rendering=!1})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(9),n(58);var l=o["default"].entityHistoryGetters,f=o["default"].entityHistoryActions;e["default"]=new u["default"]({is:"partial-history",behaviors:[c["default"]],properties:{narrow:{type:Boolean},showMenu:{type:Boolean,value:!1},isDataLoaded:{type:Boolean,bindNuclear:l.hasDataForCurrentDate,observer:"isDataLoadedChanged"},stateHistory:{type:Object,bindNuclear:l.entityHistoryForCurrentDate},isLoadingData:{type:Boolean,bindNuclear:l.isLoadingEntityHistory},selectedDate:{type:String,value:null,bindNuclear:l.currentDate}},isDataLoadedChanged:function(t){t||this.async(function(){return f.fetchSelectedDate()},1)},handleRefreshClick:function(){f.fetchSelectedDate()},datepickerFocus:function(){this.datePicker.adjustPosition()},attached:function(){this.datePicker=new window.Pikaday({field:this.$.datePicker.inputElement,onSelect:f.changeCurrentDate})},detached:function(){this.datePicker.destroy()},computeContentClasses:function(t){return"flex content "+(t?"narrow":"wide")}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(9),n(157),n(31);var l=o["default"].logbookGetters,f=o["default"].logbookActions;e["default"]=new u["default"]({is:"partial-logbook",behaviors:[c["default"]],properties:{narrow:{type:Boolean,value:!1},showMenu:{type:Boolean,value:!1},selectedDate:{type:String,bindNuclear:l.currentDate},isLoading:{type:Boolean,bindNuclear:l.isLoadingEntries},isStale:{type:Boolean,bindNuclear:l.isCurrentStale,observer:"isStaleChanged"},entries:{type:Array,bindNuclear:[l.currentEntries,function(t){return t.reverse().toArray()}]},datePicker:{type:Object}},isStaleChanged:function(t){var e=this;t&&this.async(function(){return f.fetchDate(e.selectedDate)},1)},handleRefresh:function(){f.fetchDate(this.selectedDate)},datepickerFocus:function(){this.datePicker.adjustPosition()},attached:function(){this.datePicker=new window.Pikaday({field:this.$.datePicker.inputElement,onSelect:f.changeCurrentDate})},detached:function(){this.datePicker.destroy()}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(149);var l=o["default"].configGetters,f=o["default"].entityGetters;window.L.Icon.Default.imagePath="/static/images/leaflet",e["default"]=new u["default"]({is:"partial-map",behaviors:[c["default"]],properties:{locationGPS:{type:Number,bindNuclear:l.locationGPS},locationName:{type:String,bindNuclear:l.locationName},locationEntities:{type:Array,bindNuclear:[f.visibleEntityMap,function(t){return t.valueSeq().filter(function(t){return t.attributes.latitude&&"home"!==t.state}).toArray()}]},zoneEntities:{type:Array,bindNuclear:[f.entityMap,function(t){return t.valueSeq().filter(function(t){return"zone"===t.domain&&!t.attributes.passive}).toArray()}]},narrow:{type:Boolean},showMenu:{type:Boolean,value:!1}},attached:function(){var t=this;(window.L.Browser.mobileWebkit||window.L.Browser.webkit)&&this.async(function(){var e=t.$.map,n=e.style.display;e.style.display="none",t.async(function(){e.style.display=n},1)},1)},computeMenuButtonClass:function(t,e){return!t&&e?"invisible":""},toggleMenu:function(){this.fire("open-menu")}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s),l=o["default"].notificationGetters;e["default"]=new u["default"]({is:"notification-manager",behaviors:[c["default"]],properties:{neg:{type:Boolean,value:!1},text:{type:String,bindNuclear:l.lastNotificationMessage,observer:"showNotification"}},showNotification:function(t){t&&this.$.toast.show()}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=o["default"].serviceActions;e["default"]=new u["default"]({is:"more-info-alarm_control_panel",handleDisarmTap:function(){this.callService("alarm_disarm",{code:this.enteredCode})},handleHomeTap:function(){this.callService("alarm_arm_home",{code:this.enteredCode})},handleAwayTap:function(){this.callService("alarm_arm_away",{code:this.enteredCode})},properties:{stateObj:{type:Object,observer:"stateObjChanged"},enteredCode:{type:String,value:""},disarmButtonVisible:{type:Boolean,value:!1},armHomeButtonVisible:{type:Boolean,value:!1},armAwayButtonVisible:{type:Boolean,value:!1},codeInputVisible:{type:Boolean,value:!1},codeInputEnabled:{type:Boolean,value:!1},codeFormat:{type:String,value:""},codeValid:{type:Boolean,computed:"validateCode(enteredCode, codeFormat)"}},validateCode:function(t,e){var n=new RegExp(e);return null===e?!0:n.test(t)},stateObjChanged:function(t){var e=this;t&&(this.codeFormat=t.attributes.code_format,this.codeInputVisible=null!==this.codeFormat,this.codeInputEnabled="armed_home"===t.state||"armed_away"===t.state||"disarmed"===t.state||"pending"===t.state||"triggered"===t.state,this.disarmButtonVisible="armed_home"===t.state||"armed_away"===t.state||"pending"===t.state||"triggered"===t.state,this.armHomeButtonVisible="disarmed"===t.state,this.armAwayButtonVisible="disarmed"===t.state),this.async(function(){return e.fire("iron-resize")},500)},callService:function(t,e){var n=e||{};n.entity_id=this.stateObj.entityId,s.callService("alarm_control_panel",t,n)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);e["default"]=new o["default"]({is:"more-info-camera",properties:{stateObj:{type:Object}},imageLoaded:function(){this.fire("iron-resize")},computeCameraImageUrl:function(t){return t?"/api/camera_proxy_stream/"+this.stateObj.entityId:"data:image/gif;base64,R0lGODlhAQABAAAAACw="}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(31);var l=o["default"].streamGetters,f=o["default"].syncActions,d=o["default"].serviceActions;e["default"]=new u["default"]({is:"more-info-configurator",behaviors:[c["default"]],properties:{stateObj:{type:Object},action:{type:String,value:"display"},isStreaming:{type:Boolean,bindNuclear:l.isStreamingEvents},isConfigurable:{type:Boolean,computed:"computeIsConfigurable(stateObj)"},isConfiguring:{type:Boolean,value:!1},submitCaption:{type:String,computed:"computeSubmitCaption(stateObj)"},fieldInput:{type:Object,value:{}}},computeIsConfigurable:function(t){return"configure"===t.state},computeSubmitCaption:function(t){return t.attributes.submit_caption||"Set configuration"},fieldChanged:function(t){var e=t.target;this.fieldInput[e.id]=e.value},submitClicked:function(){var t=this;this.isConfiguring=!0;var e={configure_id:this.stateObj.attributes.configure_id,fields:this.fieldInput};d.callService("configurator","configure",e).then(function(){t.isConfiguring=!1,t.isStreaming||f.fetchAll()},function(){t.isConfiguring=!1})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(36),u=r(a),s=n(204),c=r(s);n(182),n(183),n(188),n(180),n(189),n(187),n(184),n(186),n(179),n(190),n(178),n(185),e["default"]=new o["default"]({is:"more-info-content",properties:{stateObj:{type:Object,observer:"stateObjChanged"}},stateObjChanged:function(t){t&&(0,u["default"])(this,"MORE-INFO-"+(0,c["default"])(t).toUpperCase(),{stateObj:t})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=["entity_picture","friendly_name","icon","unit_of_measurement"];e["default"]=new o["default"]({is:"more-info-default",properties:{stateObj:{type:Object}},computeDisplayAttributes:function(t){return t?Object.keys(t.attributes).filter(function(t){return-1===a.indexOf(t)}):[]},getAttributeValue:function(t,e){var n=t.attributes[e];return Array.isArray(n)?n.join(", "):n}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(4),c=r(s);n(32);var l=o["default"].entityGetters,f=o["default"].moreInfoGetters;e["default"]=new u["default"]({is:"more-info-group",behaviors:[c["default"]],properties:{stateObj:{type:Object},states:{type:Array,bindNuclear:[f.currentEntity,l.entityMap,function(t,e){return t?t.attributes.entity_id.map(e.get.bind(e)):[]}]}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t,e){f.callService("light","turn_on",{entity_id:t,rgb_color:[e.r,e.g,e.b]})}Object.defineProperty(e,"__esModule",{value:!0});var o=n(2),a=r(o),u=n(1),s=r(u),c=n(33),l=r(c);n(155);var f=a["default"].serviceActions,d=["brightness","rgb_color","color_temp"];e["default"]=new s["default"]({is:"more-info-light",properties:{stateObj:{type:Object,observer:"stateObjChanged"},brightnessSliderValue:{type:Number,value:0},ctSliderValue:{type:Number,value:0}},stateObjChanged:function(t){var e=this;t&&"on"===t.state&&(this.brightnessSliderValue=t.attributes.brightness,this.ctSliderValue=t.attributes.color_temp),this.async(function(){return e.fire("iron-resize")},500)},computeClassNames:function(t){return(0,l["default"])(t,d)},brightnessSliderChanged:function(t){var e=parseInt(t.target.value,10);isNaN(e)||(0===e?f.callTurnOff(this.stateObj.entityId):f.callService("light","turn_on",{entity_id:this.stateObj.entityId,brightness:e}))},ctSliderChanged:function(t){var e=parseInt(t.target.value,10);isNaN(e)||f.callService("light","turn_on",{entity_id:this.stateObj.entityId,color_temp:e})},colorPicked:function(t){var e=this;return this.skipColorPicked?void(this.colorChanged=!0):(this.color=t.detail.rgb,i(this.stateObj.entityId,this.color),this.colorChanged=!1,this.skipColorPicked=!0,void(this.colorDebounce=setTimeout(function(){e.colorChanged&&i(e.stateObj.entityId,e.color),e.skipColorPicked=!1},500)))}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=o["default"].serviceActions;e["default"]=new u["default"]({is:"more-info-lock",properties:{stateObj:{type:Object,observer:"stateObjChanged"},enteredCode:{type:String,value:""}},handleUnlockTap:function(){this.callService("unlock",{code:this.enteredCode})},handleLockTap:function(){this.callService("lock",{code:this.enteredCode})},stateObjChanged:function(t){var e=this;t&&(this.isLocked="locked"===t.state),this.async(function(){return e.fire("iron-resize")},500)},callService:function(t,e){var n=e||{};n.entity_id=this.stateObj.entityId,s.callService("lock",t,n)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(33),c=r(s),l=o["default"].serviceActions,f=["volume_level"];e["default"]=new u["default"]({is:"more-info-media_player",properties:{stateObj:{type:Object,observer:"stateObjChanged"},isOff:{type:Boolean,value:!1},isPlaying:{type:Boolean,value:!1},isMuted:{type:Boolean,value:!1},volumeSliderValue:{type:Number,value:0},supportsPause:{type:Boolean,value:!1},supportsVolumeSet:{type:Boolean,value:!1},supportsVolumeMute:{type:Boolean,value:!1},supportsPreviousTrack:{type:Boolean,value:!1},supportsNextTrack:{type:Boolean,value:!1},supportsTurnOn:{type:Boolean,value:!1},supportsTurnOff:{type:Boolean,value:!1},supportsVolumeButtons:{type:Boolean,value:!1},hasMediaControl:{type:Boolean,value:!1}},stateObjChanged:function(t){var e=this;if(t){var n=["playing","paused","unknown"];this.isOff="off"===t.state,this.isPlaying="playing"===t.state,this.hasMediaControl=-1!==n.indexOf(t.state),this.volumeSliderValue=100*t.attributes.volume_level,this.isMuted=t.attributes.is_volume_muted,this.supportsPause=0!==(1&t.attributes.supported_media_commands),this.supportsVolumeSet=0!==(4&t.attributes.supported_media_commands),this.supportsVolumeMute=0!==(8&t.attributes.supported_media_commands),this.supportsPreviousTrack=0!==(16&t.attributes.supported_media_commands),this.supportsNextTrack=0!==(32&t.attributes.supported_media_commands),this.supportsTurnOn=0!==(128&t.attributes.supported_media_commands),this.supportsTurnOff=0!==(256&t.attributes.supported_media_commands),this.supportsVolumeButtons=0!==(1024&t.attributes.supported_media_commands)}this.async(function(){return e.fire("iron-resize")},500)},computeClassNames:function(t){return(0,c["default"])(t,f)},computeIsOff:function(t){return"off"===t.state},computeMuteVolumeIcon:function(t){return t?"mdi:volume-off":"mdi:volume-high"},computeHideVolumeButtons:function(t,e){return!e||t},computeShowPlaybackControls:function(t,e){return!t&&e},computePlaybackControlIcon:function(){return this.isPlaying?this.supportsPause?"mdi:pause":"mdi:stop":"mdi:play"},computeHidePowerButton:function(t,e,n){return t?!e:!n},handleTogglePower:function(){this.callService(this.isOff?"turn_on":"turn_off")},handlePrevious:function(){this.callService("media_previous_track")},handlePlaybackControl:function(){this.callService("media_play_pause")},handleNext:function(){this.callService("media_next_track")},handleVolumeTap:function(){this.supportsVolumeMute&&this.callService("volume_mute",{is_volume_muted:!this.isMuted})},handleVolumeUp:function(){var t=this.$.volumeUp;this.handleVolumeWorker("volume_up",t,!0)},handleVolumeDown:function(){var t=this.$.volumeDown;this.handleVolumeWorker("volume_down",t,!0)},handleVolumeWorker:function(t,e,n){var r=this;(n||void 0!==e&&e.pointerDown)&&(this.callService(t),this.async(function(){return r.handleVolumeWorker(t,e,!1)},500))},volumeSliderChanged:function(t){var e=parseFloat(t.target.value),n=e>0?e/100:0;this.callService("volume_set",{volume_level:n})},callService:function(t,e){var n=e||{};n.entity_id=this.stateObj.entityId,l.callService("media_player",t,n)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);e["default"]=new o["default"]({is:"more-info-script",properties:{stateObj:{type:Object}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a),s=n(61),c=r(s),l=u["default"].util.parseDateTime;e["default"]=new o["default"]({is:"more-info-sun",properties:{stateObj:{type:Object},risingDate:{type:Object,computed:"computeRising(stateObj)"},settingDate:{type:Object,computed:"computeSetting(stateObj)"}},computeRising:function(t){return l(t.attributes.next_rising)},computeSetting:function(t){return l(t.attributes.next_setting)},computeOrder:function(t,e){return t>e?["set","ris"]:["ris","set"]},itemCaption:function(t){return"ris"===t?"Rising ":"Setting "},itemDate:function(t){return"ris"===t?this.risingDate:this.settingDate},itemValue:function(t){return(0,c["default"])(this.itemDate(t))}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a),s=n(33),c=r(s),l=o["default"].serviceActions,f=["away_mode"];e["default"]=new u["default"]({is:"more-info-thermostat",properties:{stateObj:{type:Object,observer:"stateObjChanged"},tempMin:{type:Number},tempMax:{type:Number},targetTemperatureSliderValue:{type:Number},awayToggleChecked:{type:Boolean}},stateObjChanged:function(t){this.targetTemperatureSliderValue=t.attributes.temperature,this.awayToggleChecked="on"===t.attributes.away_mode,this.tempMin=t.attributes.min_temp,this.tempMax=t.attributes.max_temp},computeClassNames:function(t){return(0,c["default"])(t,f)},targetTemperatureSliderChanged:function(t){l.callService("thermostat","set_temperature",{entity_id:this.stateObj.entityId,temperature:t.target.value})},toggleChanged:function(t){var e=t.target.checked;e&&"off"===this.stateObj.attributes.away_mode?this.service_set_away(!0):e||"on"!==this.stateObj.attributes.away_mode||this.service_set_away(!1)},service_set_away:function(t){var e=this;l.callService("thermostat","set_away_mode",{away_mode:t,entity_id:this.stateObj.entityId}).then(function(){return e.stateObjChanged(e.stateObj)})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);e["default"]=new o["default"]({is:"more-info-updater",properties:{}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(7),n(59),e["default"]=new o["default"]({is:"state-card-configurator",properties:{inDialog:{type:Boolean,value:!1},stateObj:{type:Object}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a);n(7);var s=o["default"].serviceActions;e["default"]=new u["default"]({is:"state-card-input_select",properties:{detailed:{type:Boolean,value:!1},stateObj:{type:Object},selectedOption:{type:String,observer:"selectedOptionChanged"}},computeSelected:function(t){return t.attributes.options.indexOf(t.state)},selectedOptionChanged:function(t){""!==t&&t!==this.stateObj.state&&s.callService("input_select","select_option",{option:t,entity_id:this.stateObj.entityId})},stopPropagation:function(t){t.stopPropagation()}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a);n(7);var s=o["default"].serviceActions;e["default"]=new u["default"]({is:"state-card-input_slider",properties:{detailed:{type:Boolean,value:!1},stateObj:{type:Object,observer:"stateObjectChanged"},min:{type:Number},max:{type:Number},step:{type:Number},value:{type:Number}},stateObjectChanged:function(t){this.value=Number(t.state),this.min=Number(t.attributes.min),this.max=Number(t.attributes.max),this.step=Number(t.attributes.step)},selectedValueChanged:function(){this.value!==Number(this.stateObj.state)&&s.callService("input_slider","select_value",{value:this.value,entity_id:this.stateObj.entityId})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(7);var a=["playing","paused"];e["default"]=new o["default"]({is:"state-card-media_player",properties:{detailed:{type:Boolean,value:!1},stateObj:{type:Object},isPlaying:{type:Boolean,computed:"computeIsPlaying(stateObj)"},secondaryText:{type:String,computed:"computeSecondaryText(stateObj)"}},computeIsPlaying:function(t){return-1!==a.indexOf(t.state)},computePrimaryText:function(t,e){return e?t.attributes.media_title:t.stateDisplay},computeSecondaryText:function(t){var e=void 0;return"music"===t.attributes.media_content_type?t.attributes.media_artist:"tvshow"===t.attributes.media_content_type?(e=t.attributes.media_series_title,t.attributes.media_season&&t.attributes.media_episode&&(e+=" S"+t.attributes.media_season+"E"+t.attributes.media_episode),e):t.attributes.app_name?t.attributes.app_name:""}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(2),o=r(i),a=n(1),u=r(a);n(7);var s=o["default"].serviceActions;e["default"]=new u["default"]({is:"state-card-rollershutter",properties:{detailed:{type:Boolean,value:!1},stateObj:{type:Object}},computeIsFullyOpen:function(t){return 100===t.attributes.current_position},computeIsFullyClosed:function(t){return 0===t.attributes.current_position},onMoveUpTap:function(){s.callService("rollershutter","move_up",{entity_id:this.stateObj.entityId})},onMoveDownTap:function(){s.callService("rollershutter","move_down",{entity_id:this.stateObj.entityId})},onStopTap:function(){s.callService("rollershutter","stop",{entity_id:this.stateObj.entityId})}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a);n(7);var s=u["default"].serviceActions;e["default"]=new o["default"]({is:"state-card-scene",properties:{detailed:{type:Boolean,value:!1},stateObj:{type:Object}},activateScene:function(t){t.stopPropagation(),s.callTurnOn(this.stateObj.entityId)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i),a=n(2),u=r(a);n(7),n(29);var s=u["default"].serviceActions;e["default"]=new o["default"]({is:"state-card-script",properties:{detailed:{type:Boolean,value:!1},stateObj:{type:Object}},fireScript:function(t){t.stopPropagation(),s.callTurnOn(this.stateObj.entityId)}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(7),e["default"]=new o["default"]({is:"state-card-thermostat",properties:{detailed:{type:Boolean,value:!1},stateObj:{type:Object}},computeTargetTemperature:function(t){return t.attributes.temperature+" "+t.attributes.unit_of_measurement}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(7),n(29),e["default"]=new o["default"]({is:"state-card-toggle",properties:{detailed:{type:Boolean,value:!1},stateObj:{type:Object}}})},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}Object.defineProperty(e,"__esModule",{value:!0});var i=n(1),o=r(i);n(7),e["default"]=new o["default"]({is:"state-card-weblink",properties:{detailed:{type:Boolean,value:!1},stateObj:{type:Object}},listeners:{tap:"onTap"},onTap:function(t){t.stopPropagation(),t.target!==this.$.link&&window.open(this.stateObj.state,"_blank")}})},function(t,e){"use strict";function n(t){return{attached:function(){var e=this;this.__unwatchFns=Object.keys(this.properties).reduce(function(n,r){if(!("bindNuclear"in e.properties[r]))return n;var i=e.properties[r].bindNuclear;if(!i)throw new Error("Undefined getter specified for key "+r);return e[r]=t.evaluate(i),n.concat(t.observe(i,function(t){e[r]=t}))},[])},detached:function(){for(;this.__unwatchFns.length;)this.__unwatchFns.shift()()}}}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n},function(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=["off","closed","unlocked"]},function(t,e,n){"use strict";function r(t){return t&&t.__esModule?t:{"default":t}}function i(t){return"unavailable"===t.state?"display":-1!==u.indexOf(t.domain)?t.domain:(0,a["default"])(t.entityId)?"toggle":"display"}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=i;var o=n(34),a=r(o),u=["configurator","input_select","input_slider","media_player","rollershutter","scene","script","thermostat","weblink"]},function(t,e){"use strict";function n(t){return-1!==r.indexOf(t.domain)?t.domain:"default"}Object.defineProperty(e,"__esModule",{value:!0}),e["default"]=n;var r=["light","group","sun","configurator","thermostat","script","media_player","camera","updater","alarm_control_panel","lock"]},function(t,e,n){var r,i;!function(){"use strict";function n(){for(var t=[],e=0;et;t+=2){var e=rt[t],n=rt[t+1];e(n),rt[t]=void 0,rt[t+1]=void 0}$=0}function v(){try{var t=n(224);return W=t.runOnLoop||t.runOnContext,f()}catch(e){return p()}}function y(t,e){var n=this,r=n._state;if(r===ut&&!t||r===st&&!e)return this;var i=new this.constructor(g),o=n._result;if(r){var a=arguments[r-1];Z(function(){ +N(r,i,a,o)})}else P(n,i,t,e);return i}function m(t){var e=this;if(t&&"object"==typeof t&&t.constructor===e)return t;var n=new e(g);return E(n,t),n}function g(){}function b(){return new TypeError("You cannot resolve a promise with itself")}function S(){return new TypeError("A promises callback cannot return that same promise.")}function w(t){try{return t.then}catch(e){return ct.error=e,ct}}function O(t,e,n,r){try{t.call(e,n,r)}catch(i){return i}}function M(t,e,n){Z(function(t){var r=!1,i=O(n,e,function(n){r||(r=!0,e!==n?E(t,n):j(t,n))},function(e){r||(r=!0,C(t,e))},"Settle: "+(t._label||" unknown promise"));!r&&i&&(r=!0,C(t,i))},t)}function I(t,e){e._state===ut?j(t,e._result):e._state===st?C(t,e._result):P(e,void 0,function(e){E(t,e)},function(e){C(t,e)})}function T(t,e,n){e.constructor===t.constructor&&n===it&&constructor.resolve===ot?I(t,e):n===ct?C(t,ct.error):void 0===n?j(t,e):u(n)?M(t,e,n):j(t,e)}function E(t,e){t===e?C(t,b()):a(e)?T(t,e,w(e)):j(t,e)}function D(t){t._onerror&&t._onerror(t._result),A(t)}function j(t,e){t._state===at&&(t._result=e,t._state=ut,0!==t._subscribers.length&&Z(A,t))}function C(t,e){t._state===at&&(t._state=st,t._result=e,Z(D,t))}function P(t,e,n,r){var i=t._subscribers,o=i.length;t._onerror=null,i[o]=e,i[o+ut]=n,i[o+st]=r,0===o&&t._state&&Z(A,t)}function A(t){var e=t._subscribers,n=t._state;if(0!==e.length){for(var r,i,o=t._result,a=0;aa;a++)P(r.resolve(t[a]),void 0,e,n);return i}function Y(t){var e=this,n=new e(g);return C(n,t),n}function z(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}function U(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}function V(t){this._id=pt++,this._state=void 0,this._result=void 0,this._subscribers=[],g!==t&&("function"!=typeof t&&z(),this instanceof V?x(this,t):U())}function B(t,e){this._instanceConstructor=t,this.promise=new t(g),Array.isArray(e)?(this._input=e,this.length=e.length,this._remaining=e.length,this._result=new Array(this.length),0===this.length?j(this.promise,this._result):(this.length=this.length||0,this._enumerate(),0===this._remaining&&j(this.promise,this._result))):C(this.promise,this._validationError())}function G(){var t;if("undefined"!=typeof i)t=i;else if("undefined"!=typeof self)t=self;else try{t=Function("return this")()}catch(e){throw new Error("polyfill failed because global object is unavailable in this environment")}var n=t.Promise;n&&"[object Promise]"===Object.prototype.toString.call(n.resolve())&&!n.cast||(t.Promise=_t)}var F;F=Array.isArray?Array.isArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)};var W,q,K,J=F,$=0,Z=function(t,e){rt[$]=t,rt[$+1]=e,$+=2,2===$&&(q?q(_):K())},X="undefined"!=typeof window?window:void 0,Q=X||{},tt=Q.MutationObserver||Q.WebKitMutationObserver,et="undefined"!=typeof t&&"[object process]"==={}.toString.call(t),nt="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel,rt=new Array(1e3);K=et?l():tt?d():nt?h():void 0===X?v():p();var it=y,ot=m,at=void 0,ut=1,st=2,ct=new k,lt=new k,ft=R,dt=H,ht=Y,pt=0,_t=V;V.all=ft,V.race=dt,V.resolve=ot,V.reject=ht,V._setScheduler=s,V._setAsap=c,V._asap=Z,V.prototype={constructor:V,then:it,"catch":function(t){return this.then(null,t)}};var vt=B;B.prototype._validationError=function(){return new Error("Array Methods must be provided an Array")},B.prototype._enumerate=function(){for(var t=this.length,e=this._input,n=0;this._state===at&&t>n;n++)this._eachEntry(e[n],n)},B.prototype._eachEntry=function(t,e){var n=this._instanceConstructor,r=n.resolve;if(r===ot){var i=w(t);if(i===it&&t._state!==at)this._settledAt(t._state,e,t._result);else if("function"!=typeof i)this._remaining--,this._result[e]=t;else if(n===_t){var o=new n(g);T(o,t,i),this._willSettleAt(o,e)}else this._willSettleAt(new n(function(e){e(t)}),e)}else this._willSettleAt(r(t),e)},B.prototype._settledAt=function(t,e,n){var r=this.promise;r._state===at&&(this._remaining--,t===st?C(r,n):this._result[e]=n),0===this._remaining&&j(r,this._result)},B.prototype._willSettleAt=function(t,e){var n=this;P(t,void 0,function(t){n._settledAt(ut,e,t)},function(t){n._settledAt(st,e,t)})};var yt=G,mt={Promise:_t,polyfill:yt};n(223).amd?(r=function(){return mt}.call(e,n,e,o),!(void 0!==r&&(o.exports=r))):"undefined"!=typeof o&&o.exports?o.exports=mt:"undefined"!=typeof this&&(this.ES6Promise=mt),yt()}).call(this)}).call(e,n(222),function(){return this}(),n(69)(t))},function(t,e){function n(t){return function(e){return null==e?void 0:e[t]}}t.exports=n},function(t,e){function n(t,e,n,o){for(var a=-1,u=i(r((e-t)/(n||1)),0),s=Array(u);u--;)s[o?u:++a]=t,t+=n;return s}var r=Math.ceil,i=Math.max;t.exports=n},function(t,e,n){function r(t){return function(e,n,r){return r&&"number"!=typeof r&&o(e,n,r)&&(n=r=void 0),e=a(e),e=e===e?e:0,void 0===n?(n=e,e=0):n=a(n)||0,r=void 0===r?n>e?1:-1:a(r)||0,i(e,n,r,t)}}var i=n(208),o=n(212),a=n(66);t.exports=r},function(t,e,n){var r=n(207),i=r("length");t.exports=i},function(t,e){function n(t,e){return t="number"==typeof t||i.test(t)?+t:-1,e=null==e?r:e,t>-1&&t%1==0&&e>t}var r=9007199254740991,i=/^(?:0|[1-9]\d*)$/;t.exports=n},function(t,e,n){function r(t,e,n){if(!u(n))return!1;var r=typeof e;return("number"==r?o(n)&&a(e,n.length):"string"==r&&e in n)?i(n[e],t):!1}var i=n(213),o=n(215),a=n(211),u=n(17);t.exports=r},function(t,e){function n(t,e){return t===e||t!==t&&e!==e}t.exports=n},function(t,e){var n=Array.isArray;t.exports=n},function(t,e,n){function r(t){return null!=t&&a(i(t))&&!o(t)}var i=n(210),o=n(37),a=n(216);t.exports=r},function(t,e){function n(t){return"number"==typeof t&&t>-1&&t%1==0&&r>=t}var r=9007199254740991;t.exports=n},function(t,e){function n(t){return!!t&&"object"==typeof t}t.exports=n},function(t,e,n){function r(t){return"symbol"==typeof t||i(t)&&u.call(t)==o}var i=n(217),o="[object Symbol]",a=Object.prototype,u=a.toString;t.exports=r},function(t,e){var n=Date.now;t.exports=n},function(t,e,n){var r=n(209),i=r();t.exports=i},function(t,e){function n(t){throw new Error("Cannot find module '"+t+"'.")}n.keys=function(){return[]},n.resolve=n,t.exports=n,n.id=221},function(t,e){function n(){c=!1,a.length?s=a.concat(s):l=-1,s.length&&r()}function r(){if(!c){var t=setTimeout(n);c=!0;for(var e=s.length;e;){for(a=s,s=[];++l1)for(var n=1;n \ No newline at end of file diff --git a/homeassistant/components/frontend/www_static/home-assistant-polymer b/homeassistant/components/frontend/www_static/home-assistant-polymer index de852d20bd6..8c3522bb40c 160000 --- a/homeassistant/components/frontend/www_static/home-assistant-polymer +++ b/homeassistant/components/frontend/www_static/home-assistant-polymer @@ -1 +1 @@ -Subproject commit de852d20bd635796c1a2d15befae79e7d0a2fae6 +Subproject commit 8c3522bb40ca1317a3868f187ea02b0f7a76e9c8 diff --git a/homeassistant/components/frontend/www_static/images/card_media_player_bg.png b/homeassistant/components/frontend/www_static/images/card_media_player_bg.png new file mode 100644 index 0000000000000000000000000000000000000000..6c97dd2f511e452acfb0c60c02edda828f266e7a GIT binary patch literal 1547 zcmeAS@N?(olHy`uVBq!ia0y~yV6bCgU@+ofV_;xlVa~8;U|^6eag8Vm&QB{TPb^Ah za7@WhN>%X8O-xS>N=;0uEIgTN!@$6-k{J?F65;D(m7Jfemk3g$SCL!500K7l6$OdO z*{LN8NvY|XdA3ULckfqH$V{%1*XSQL?vFu&J=B z$SufCElE_U$j!+swyLmI0-I}l#hD=EpgRf0Gw!Z$#{Ilm}X!Bo#!H`&0@ zP{GVh&(Orw%*;?n!N|bSNZ-In-@r`Q(8S8r%*x1I0Sc7t6l{u8(yW49+@N+9rKH&^ zWt5Z@Sn2DRmzV368|&p4rRy77T3Uk4Ff!6DN=ef#uFNY*tkBIXR)(42l3JWxlvz-c znV+WsGBGhJzqG_wNeOCfMQ(wwFWlg~VrW1m=jZBIBo^o!>KW+g=7RhM_Hc1YP%6S1 zSXCE?R2HP_2c;J0mlh?b2BoGcBUy#tB9OuYUtcSi{N&Qy)VvZ;7h9!@+ycFn%oHml zBU1x&GdD*!3v*{fLswHrOAAvcb03>z#~@EX`e=EX^H_49qMH4K0j}99;~JEln+)+{{fKot2<^Q?U4)pk94D z1si=()FMSSOeo034a5YeN>B>5Q$QsB)Vvg1r6MJJyNf&ig)%TO)q1)(hE&{o6Lr$> zuz^77rAthVy9B&$wm8h$@#+8n1C7ES3W@@{-V;yxO*dfH(^Bkvdn51CG5@MnPj(o8 z&N(i3yRbIn-(Y+0|M!Nk9Yvz|eRd@8XFpK; zz{|rViPz%z#;<&D3~EeRlXfz)2|m@@xAV}(t=e;{v=096;@!UR!EDVHUMHEi)pQ0w zXa13(P!WI7Jov||gxGYagZHIB$ZFo1Tw%Il;;A`S^ScgimpHikN1w<$FOKP%KNmWE zC}*p2_scU{arvn--`*Jy%vq~zSKQnl)PH(Q&25JdtM>ipC>Q$ntI6TR_MY@bd+iJ! z{FZi|B(wW~x}WT{+A{*%S<@cGxfm^d^*jBA!>KBlB97@#M8bB6=Cz(T>uP%&&-|P1 zjTy_ePa&=48SmCghlV~ZTj9@;+BjE|yU}6Uw8)1Q0vCOL#Gkp@|8`AYYxF~~RuJVI zX}Zw6bGP9hg*7T$nvWmiSByR#Dbn{nR{X&9fJ*JgwdoHmf7Va`H^cPdj;A(Pw|uQ( zo+sG&dcMw{$Kg`nZ%>~rv{vg+@MD3R<%esu(!PfG7M{4pbxB0eTE|-|cj>LiswaOH zF4zAol`AR!&T|dd4l(^>Ht~}(JaU$_nzVMueG-o9FPGh`nvreIeOj`P^Xh{uk?Qu( zb8W6zKHB)OOvK3P?abSJvfp%Pwe&O`7Th1V!t+MfrNsVi^Ij}zpS#& Date: Tue, 12 Apr 2016 14:18:18 +0200 Subject: [PATCH 047/114] Update links --- .github/PULL_REQUEST_TEMPLATE.md | 4 ++-- .gitmodules | 2 +- CONTRIBUTING.md | 18 +++++++++--------- setup.py | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 3d87814ac8b..bb40754c97a 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -23,6 +23,6 @@ If the code does not interact with devices: [fork]: http://stackoverflow.com/a/7244456 [squash]: https://github.com/ginatrapani/todo.txt-android/wiki/Squash-All-Commits-Related-to-a-Single-Issue-into-a-Single-Commit -[ex-requir]: https://github.com/balloob/home-assistant/blob/dev/homeassistant/components/keyboard.py#L16 -[ex-import]: https://github.com/balloob/home-assistant/blob/dev/homeassistant/components/keyboard.py#L51 +[ex-requir]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard.py#L16 +[ex-import]: https://github.com/home-assistant/home-assistant/blob/dev/homeassistant/components/keyboard.py#L51 diff --git a/.gitmodules b/.gitmodules index ad28a4e2c8a..49d8dace9a4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "homeassistant/components/frontend/www_static/home-assistant-polymer"] path = homeassistant/components/frontend/www_static/home-assistant-polymer - url = https://github.com/balloob/home-assistant-polymer.git + url = https://github.com/home-assistant/home-assistant-polymer.git diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2028161458e..221b46c65ee 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,10 +4,10 @@ Everybody is invited and welcome to contribute to Home Assistant. There is a lot The process is straight-forward. - - Fork the Home Assistant [git repository](https://github.com/balloob/home-assistant). + - Fork the Home Assistant [git repository](https://github.com/home-assistant/home-assistant). - Write the code for your device, notification service, sensor, or IoT thing. - Ensure tests work. - - Create a Pull Request against the [**dev**](https://github.com/balloob/home-assistant/tree/dev) branch of Home Assistant. + - Create a Pull Request against the [**dev**](https://github.com/home-assistant/home-assistant/tree/dev) branch of Home Assistant. Still interested? Then you should read the next sections and get more details. @@ -20,20 +20,20 @@ After you finish adding support for your device: - Check that all dependencies are included via the `REQUIREMENTS` variable in your platform/component and only imported inside functions that use them. - Add any new dependencies to `requirements_all.txt` if needed. Use `script/gen_requirements_all.py`. - Update the `.coveragerc` file to exclude your platform if there are no tests available or your new code uses a 3rd party library for communication with the device/service/sensor. - - Provide some documentation for [home-assistant.io](https://home-assistant.io/). It's OK to just add a docstring with configuration details (sample entry for `configuration.yaml` file and alike) to the file header as a start. Visit the [website documentation](https://home-assistant.io/developers/website/) for further information on contributing to [home-assistant.io](https://github.com/balloob/home-assistant.io). + - Provide some documentation for [home-assistant.io](https://home-assistant.io/). It's OK to just add a docstring with configuration details (sample entry for `configuration.yaml` file and alike) to the file header as a start. Visit the [website documentation](https://home-assistant.io/developers/website/) for further information on contributing to [home-assistant.io](https://github.com/home-assistant/home-assistant.io). - Make sure all your code passes ``pylint`` and ``flake8`` (PEP8 and some more) validation. To check your repository, run `tox` or `script/lint`. - - Create a Pull Request against the [**dev**](https://github.com/balloob/home-assistant/tree/dev) branch of Home Assistant. - - Check for comments and suggestions on your Pull Request and keep an eye on the [CI output](https://travis-ci.org/balloob/home-assistant/). + - Create a Pull Request against the [**dev**](https://github.com/home-assistant/home-assistant/tree/dev) branch of Home Assistant. + - Check for comments and suggestions on your Pull Request and keep an eye on the [CI output](https://travis-ci.org/home-assistant/home-assistant/). If you add a platform for an existing component, there is usually no need for updating the frontend. Only if you've added a new component that should show up in the frontend, there are more steps needed: - - Update the file [`home-assistant-icons.html`](https://github.com/balloob/home-assistant/blob/master/homeassistant/components/frontend/www_static/polymer/resources/home-assistant-icons.html) with an icon for your domain ([pick one from this list](https://www.polymer-project.org/1.0/components/core-elements/demo.html#core-icon)). + - Update the file [`home-assistant-icons.html`](https://github.com/home-assistant/home-assistant/blob/master/homeassistant/components/frontend/www_static/polymer/resources/home-assistant-icons.html) with an icon for your domain ([pick one from this list](https://www.polymer-project.org/1.0/components/core-elements/demo.html#core-icon)). - Update the demo component with two states that it provides. - Add your component to `home-assistant.conf.example`. Since you've updated `home-assistant-icons.html`, you've made changes to the frontend: - - Run `build_frontend`. This will build a new version of the frontend. Make sure you add the changed files `frontend.py` and `frontend.html` to the commit. + - Run `script/build_frontend`. This will build a new version of the frontend. Make sure you add the changed files `frontend.py` and `frontend.html` to the commit. ### Setting states @@ -46,11 +46,11 @@ A state can have several attributes that will help the frontend in displaying yo - `unit_of_measurement`: this will be appended to the state in the interface - `hidden`: This is a suggestion to the frontend on if the state should be hidden -These attributes are defined in [homeassistant.components](https://github.com/balloob/home-assistant/blob/master/homeassistant/components/__init__.py#L25). +These attributes are defined in [homeassistant.components](https://github.com/home-assistant/home-assistant/blob/master/homeassistant/components/__init__.py#L25). ### Proper Visibility Handling -Generally, when creating a new entity for Home Assistant you will want it to be a class that inherits the [homeassistant.helpers.entity.Entity](https://github.com/balloob/home-assistant/blob/master/homeassistant/helpers/entity.py) class. If this is done, visibility will be handled for you. +Generally, when creating a new entity for Home Assistant you will want it to be a class that inherits the [homeassistant.helpers.entity.Entity](https://github.com/home-assistant/home-assistant/blob/master/homeassistant/helpers/entity.py) class. If this is done, visibility will be handled for you. You can set a suggestion for your entity's visibility by setting the hidden property by doing something similar to the following. ```python diff --git a/setup.py b/setup.py index 9569529fc84..6e67dc3f075 100755 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ from homeassistant.const import __version__ PACKAGE_NAME = 'homeassistant' HERE = os.path.abspath(os.path.dirname(__file__)) -DOWNLOAD_URL = ('https://github.com/balloob/home-assistant/archive/' +DOWNLOAD_URL = ('https://github.com/home-assistant/home-assistant/archive/' '{}.zip'.format(__version__)) PACKAGES = find_packages(exclude=['tests', 'tests.*']) From cd80e41b3268b2e7b2f909f02a908cd7afe163b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=B8yer=20Iversen?= Date: Tue, 12 Apr 2016 16:54:03 +0200 Subject: [PATCH 048/114] Allow negative elevation in yr config --- homeassistant/components/sensor/yr.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/sensor/yr.py b/homeassistant/components/sensor/yr.py index 593cb1cf061..4e7a7be3451 100644 --- a/homeassistant/components/sensor/yr.py +++ b/homeassistant/components/sensor/yr.py @@ -46,7 +46,7 @@ PLATFORM_SCHEMA = vol.Schema({ [vol.In(SENSOR_TYPES.keys())], vol.Optional(CONF_LATITUDE): cv.latitude, vol.Optional(CONF_LONGITUDE): cv.longitude, - vol.Optional(CONF_ELEVATION): cv.positive_int, + vol.Optional(CONF_ELEVATION): vol.Coerce(int), }) From 0bf49aea6f41904efaf0840f1a3135c5bcde1055 Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Tue, 12 Apr 2016 14:43:04 -0400 Subject: [PATCH 049/114] New version of betamax breaks the yr.no sensor test. Pin to betamax-0.5.1 for now. --- requirements_test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_test.txt b/requirements_test.txt index 162a4d89ee5..ebe359e7b54 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -4,5 +4,5 @@ coveralls>=1.1 pytest>=2.8.0 pytest-cov>=2.2.0 pytest-timeout>=1.0.0 -betamax>=0.5.1 +betamax==0.5.1 pydocstyle>=1.0.0 From ebf45012fb4e4f8d8d9e56286e73ad9ba7b8ea3f Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Tue, 12 Apr 2016 14:56:14 -0400 Subject: [PATCH 050/114] Ignore tests/config/deps/ for both git and flake8. Sometimes py.test leave some packages around in tests/config/deps. Make sure these do not accidentally get pulled into a commit or cause a local tox run to fail. --- .gitignore | 1 + setup.cfg | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e7d64517e17..5a3fa9649c0 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ config/custom_components/* !config/custom_components/hello_world.py !config/custom_components/mqtt_example.py +tests/config/deps tests/config/home-assistant.log # Hide sublime text stuff diff --git a/setup.cfg b/setup.cfg index a9a21de8388..2333efe6e70 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,4 +5,4 @@ universal = 1 testpaths = tests [flake8] -exclude = .venv,.git,.tox,docs,www_static,venv,bin,lib +exclude = .venv,.git,.tox,docs,www_static,venv,bin,lib,deps From c4a71fbfa78a72e9d598e62cdcc6f3b6fb735c33 Mon Sep 17 00:00:00 2001 From: Josh Wright Date: Tue, 12 Apr 2016 18:15:24 -0400 Subject: [PATCH 051/114] Include away temps in target temps The target temperature methods were not taking the 'away' status into account. leading to misleading target temps being reported. --- homeassistant/components/thermostat/nest.py | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/thermostat/nest.py b/homeassistant/components/thermostat/nest.py index 9a52f58c1d9..2426e638c43 100644 --- a/homeassistant/components/thermostat/nest.py +++ b/homeassistant/components/thermostat/nest.py @@ -80,10 +80,9 @@ class NestThermostat(ThermostatDevice): @property def target_temperature(self): """Return the temperature we try to reach.""" - target = self.device.target - if self.device.mode == 'range': - low, high = target + low, high = self.target_temperature_low, \ + self.target_temperature_high if self.operation == STATE_COOL: temp = high elif self.operation == STATE_HEAT: @@ -95,13 +94,22 @@ class NestThermostat(ThermostatDevice): elif self.current_temperature >= range_average: temp = high else: - temp = target + if self.is_away_mode_on: + # away_temperature is a low, high tuple. Only one should be set + # if not in range mode, the other will be None + temp = self.device.away_temperature[0] or \ + self.device.away_temperature[1] + else: + temp = self.device.target return temp @property def target_temperature_low(self): """Return the lower bound temperature we try to reach.""" + if self.is_away_mode_on and self.device.away_temperature[0]: + # away_temperature is always a low, high tuple + return self.device.away_temperature[0] if self.device.mode == 'range': return self.device.target[0] return self.target_temperature @@ -109,6 +117,9 @@ class NestThermostat(ThermostatDevice): @property def target_temperature_high(self): """Return the upper bound temperature we try to reach.""" + if self.is_away_mode_on and self.device.away_temperature[1]: + # away_temperature is always a low, high tuple + return self.device.away_temperature[1] if self.device.mode == 'range': return self.device.target[1] return self.target_temperature From 942d722dcf8e2ccd5fef0775f689ac87b7926e81 Mon Sep 17 00:00:00 2001 From: Josh Wright Date: Tue, 12 Apr 2016 18:25:24 -0400 Subject: [PATCH 052/114] Improve target temperature selection logic When picking which of the high/low temperatures to display as the "target", it makes more sense to take the outside temperature into consideration, rather than the current temperature of the thermostat. If the temperature outside is less than the temperature of the thermostat, then we are far more likely to end up in "heating" mode eventually, and vice versa, regardless of where the current inside temp falls in the range between high and low. --- homeassistant/components/thermostat/nest.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/thermostat/nest.py b/homeassistant/components/thermostat/nest.py index 2426e638c43..7f78b4b2238 100644 --- a/homeassistant/components/thermostat/nest.py +++ b/homeassistant/components/thermostat/nest.py @@ -88,8 +88,10 @@ class NestThermostat(ThermostatDevice): elif self.operation == STATE_HEAT: temp = low else: - range_average = (low + high)/2 - if self.current_temperature < range_average: + # If the outside temp is lower than the current temp, consider + # the 'low' temp to the target, otherwise use the high temp + if (self.device.structure.weather.current.temperature < + self.current_temperature): temp = low elif self.current_temperature >= range_average: temp = high From 1685bbe1f7b39682d0b526ce4dd199c1f49a9054 Mon Sep 17 00:00:00 2001 From: Josh Wright Date: Tue, 12 Apr 2016 18:45:57 -0400 Subject: [PATCH 053/114] Fix copy/paste logic error --- homeassistant/components/thermostat/nest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/thermostat/nest.py b/homeassistant/components/thermostat/nest.py index 7f78b4b2238..63892238f58 100644 --- a/homeassistant/components/thermostat/nest.py +++ b/homeassistant/components/thermostat/nest.py @@ -93,7 +93,7 @@ class NestThermostat(ThermostatDevice): if (self.device.structure.weather.current.temperature < self.current_temperature): temp = low - elif self.current_temperature >= range_average: + else: temp = high else: if self.is_away_mode_on: From 4aa43bbf7aca57056878d29387986dd61ca4afe4 Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Tue, 12 Apr 2016 14:43:04 -0400 Subject: [PATCH 054/114] New version of betamax breaks the yr.no sensor test. Pin to betamax-0.5.1 for now. --- requirements_test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements_test.txt b/requirements_test.txt index 162a4d89ee5..ebe359e7b54 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -4,5 +4,5 @@ coveralls>=1.1 pytest>=2.8.0 pytest-cov>=2.2.0 pytest-timeout>=1.0.0 -betamax>=0.5.1 +betamax==0.5.1 pydocstyle>=1.0.0 From 0e10f7ced903dfe193c9810d16f9792475a95d28 Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Tue, 12 Apr 2016 14:56:14 -0400 Subject: [PATCH 055/114] Ignore tests/config/deps/ for both git and flake8. Sometimes py.test leave some packages around in tests/config/deps. Make sure these do not accidentally get pulled into a commit or cause a local tox run to fail. --- .gitignore | 1 + setup.cfg | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e7d64517e17..5a3fa9649c0 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ config/custom_components/* !config/custom_components/hello_world.py !config/custom_components/mqtt_example.py +tests/config/deps tests/config/home-assistant.log # Hide sublime text stuff diff --git a/setup.cfg b/setup.cfg index a9a21de8388..2333efe6e70 100644 --- a/setup.cfg +++ b/setup.cfg @@ -5,4 +5,4 @@ universal = 1 testpaths = tests [flake8] -exclude = .venv,.git,.tox,docs,www_static,venv,bin,lib +exclude = .venv,.git,.tox,docs,www_static,venv,bin,lib,deps From c121c9aa392f1a505e5740d023124d37c15f2512 Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Tue, 12 Apr 2016 21:37:10 -0700 Subject: [PATCH 056/114] Fix links in README.rst --- README.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index c66b3670f32..69856586be0 100644 --- a/README.rst +++ b/README.rst @@ -1,4 +1,4 @@ -Home Assistant |Build Status| |Coverage Status| |Join the chat at https://gitter.im/balloob/home-assistant| +Home Assistant |Build Status| |Coverage Status| |Join the chat at https://gitter.im/home-assistant/home-assistant| =========================================================================================================== Home Assistant is a home automation platform running on Python 3. The @@ -88,11 +88,11 @@ If you run into issues while using Home Assistant or during development of a component, check the `Home Assistant help section `__ how to reach us. -.. |Build Status| image:: https://travis-ci.org/balloob/home-assistant.svg?branch=master - :target: https://travis-ci.org/balloob/home-assistant -.. |Coverage Status| image:: https://img.shields.io/coveralls/balloob/home-assistant.svg - :target: https://coveralls.io/r/balloob/home-assistant?branch=master -.. |Join the chat at https://gitter.im/balloob/home-assistant| image:: https://badges.gitter.im/Join%20Chat.svg - :target: https://gitter.im/balloob/home-assistant?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge -.. |screenshot-states| image:: https://raw.github.com/balloob/home-assistant/master/docs/screenshots.png +.. |Build Status| image:: https://travis-ci.org/home-assistant/home-assistant.svg?branch=master + :target: https://travis-ci.org/home-assistant/home-assistant +.. |Coverage Status| image:: https://img.shields.io/coveralls/home-assistant/home-assistant.svg + :target: https://coveralls.io/r/home-assistant/home-assistant?branch=master +.. |Join the chat at https://gitter.im/home-assistant/home-assistant| image:: https://badges.gitter.im/Join%20Chat.svg + :target: https://gitter.im/home-assistant/home-assistant?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge +.. |screenshot-states| image:: https://raw.github.com/home-assistant/home-assistant/master/docs/screenshots.png :target: https://home-assistant.io/demo/ From 1f96c4ad88408b6e5950c1e750d179f4eaf69ca3 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 12 Apr 2016 23:57:07 -0700 Subject: [PATCH 057/114] Update submodule --- .../components/frontend/www_static/home-assistant-polymer | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/frontend/www_static/home-assistant-polymer b/homeassistant/components/frontend/www_static/home-assistant-polymer index 8c3522bb40c..edafede8e4e 160000 --- a/homeassistant/components/frontend/www_static/home-assistant-polymer +++ b/homeassistant/components/frontend/www_static/home-assistant-polymer @@ -1 +1 @@ -Subproject commit 8c3522bb40ca1317a3868f187ea02b0f7a76e9c8 +Subproject commit edafede8e4e1097b42dde4eb7b772abd3183386e From 05469e6d9b0e0557e762a59658a5b58d4ba864e4 Mon Sep 17 00:00:00 2001 From: Robbie Trencheny Date: Wed, 13 Apr 2016 00:40:12 -0700 Subject: [PATCH 058/114] Update pyGTFS version --- homeassistant/components/sensor/gtfs.py | 2 +- requirements_all.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/sensor/gtfs.py b/homeassistant/components/sensor/gtfs.py index 4cd1655e6dc..cdea0d24624 100644 --- a/homeassistant/components/sensor/gtfs.py +++ b/homeassistant/components/sensor/gtfs.py @@ -13,7 +13,7 @@ from homeassistant.helpers.entity import Entity _LOGGER = logging.getLogger(__name__) REQUIREMENTS = ["https://github.com/robbiet480/pygtfs/archive/" - "6b40d5fb30fd410cfaf637c901b5ed5a08c33e4c.zip#" + "432414b720c580fb2667a0a48f539118a2d95969.zip#" "pygtfs==0.1.2"] ICON = "mdi:train" diff --git a/requirements_all.txt b/requirements_all.txt index 06ec08f89e0..ed1ad1bcdf2 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -102,7 +102,7 @@ https://github.com/rkabadi/pyedimax/archive/365301ce3ff26129a7910c501ead09ea625f https://github.com/rkabadi/temper-python/archive/3dbdaf2d87b8db9a3cd6e5585fc704537dd2d09b.zip#temperusb==1.2.3 # homeassistant.components.sensor.gtfs -https://github.com/robbiet480/pygtfs/archive/6b40d5fb30fd410cfaf637c901b5ed5a08c33e4c.zip#pygtfs==0.1.2 +https://github.com/robbiet480/pygtfs/archive/432414b720c580fb2667a0a48f539118a2d95969.zip#pygtfs==0.1.2 # homeassistant.components.scene.hunterdouglas_powerview https://github.com/sander76/powerviewApi/archive/master.zip#powerviewApi==0.2 From 85901d60c462e248517d0d8406088db83bfa6916 Mon Sep 17 00:00:00 2001 From: Fabian Affolter Date: Wed, 13 Apr 2016 13:50:28 +0200 Subject: [PATCH 059/114] Update file header and fix typos --- config/custom_components/mqtt_example.py | 4 ++-- homeassistant/components/mqtt/__init__.py | 6 +++--- homeassistant/components/mqtt/server.py | 7 ++++++- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/config/custom_components/mqtt_example.py b/config/custom_components/mqtt_example.py index b4e5e89a977..451a60deef4 100644 --- a/config/custom_components/mqtt_example.py +++ b/config/custom_components/mqtt_example.py @@ -14,7 +14,7 @@ To use the mqtt_example component you will need to add the following to your configuration.yaml file. mqtt_example: - topic: home-assistant/mqtt_example + topic: "home-assistant/mqtt_example" """ import homeassistant.loader as loader @@ -29,7 +29,7 @@ DEFAULT_TOPIC = 'home-assistant/mqtt_example' def setup(hass, config): - """Setup the MQTT example component.""" + """Setup the MQTT example component.""" mqtt = loader.get_component('mqtt') topic = config[DOMAIN].get('topic', DEFAULT_TOPIC) entity_id = 'mqtt_example.last_message' diff --git a/homeassistant/components/mqtt/__init__.py b/homeassistant/components/mqtt/__init__.py index 510aedb00e2..d0843ebdcef 100644 --- a/homeassistant/components/mqtt/__init__.py +++ b/homeassistant/components/mqtt/__init__.py @@ -1,5 +1,5 @@ """ -Support for MQTT message handling.. +Support for MQTT message handling. For more details about this component, please refer to the documentation at https://home-assistant.io/components/mqtt/ @@ -102,13 +102,13 @@ MQTT_BASE_PLATFORM_SCHEMA = vol.Schema({ vol.Optional(CONF_QOS, default=DEFAULT_QOS): _VALID_QOS_SCHEMA, }) -# Sensor type platforms subscribe to mqtt events +# Sensor type platforms subscribe to MQTT events MQTT_RO_PLATFORM_SCHEMA = MQTT_BASE_PLATFORM_SCHEMA.extend({ vol.Required(CONF_STATE_TOPIC): valid_subscribe_topic, vol.Optional(CONF_VALUE_TEMPLATE): cv.template, }) -# Switch type platforms publish to mqtt and may subscribe +# Switch type platforms publish to MQTT and may subscribe MQTT_RW_PLATFORM_SCHEMA = MQTT_BASE_PLATFORM_SCHEMA.extend({ vol.Required(CONF_COMMAND_TOPIC): valid_publish_topic, vol.Optional(CONF_RETAIN, default=DEFAULT_RETAIN): cv.boolean, diff --git a/homeassistant/components/mqtt/server.py b/homeassistant/components/mqtt/server.py index eba8ce37b3c..e54e0f70ad0 100644 --- a/homeassistant/components/mqtt/server.py +++ b/homeassistant/components/mqtt/server.py @@ -1,4 +1,9 @@ -"""MQTT server.""" +""" +Support for a local MQTT broker. + +For more details about this component, please refer to the documentation at +https://home-assistant.io/components/mqtt/#use-the-embedded-broker +""" import asyncio import logging import tempfile From 730514cea8dab3bf4edbe0062ee8d7f139e680d5 Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Tue, 12 Apr 2016 00:27:11 -0400 Subject: [PATCH 060/114] Service validation for the thermostat component. --- .../components/thermostat/__init__.py | 51 +++++++++---------- 1 file changed, 25 insertions(+), 26 deletions(-) diff --git a/homeassistant/components/thermostat/__init__.py b/homeassistant/components/thermostat/__init__.py index eb1b926a2e3..7e2ff9f2234 100644 --- a/homeassistant/components/thermostat/__init__.py +++ b/homeassistant/components/thermostat/__init__.py @@ -7,14 +7,16 @@ https://home-assistant.io/components/thermostat/ import logging import os +import voluptuous as vol + from homeassistant.helpers.entity_component import EntityComponent from homeassistant.config import load_yaml_config_file -import homeassistant.util as util from homeassistant.helpers.entity import Entity from homeassistant.helpers.temperature import convert from homeassistant.helpers.config_validation import PLATFORM_SCHEMA # noqa from homeassistant.components import (ecobee, zwave) +import homeassistant.helpers.config_validation as cv from homeassistant.const import ( ATTR_ENTITY_ID, ATTR_TEMPERATURE, STATE_ON, STATE_OFF, STATE_UNKNOWN, TEMP_CELCIUS) @@ -48,6 +50,19 @@ DISCOVERY_PLATFORMS = { zwave.DISCOVER_THERMOSTATS: 'zwave' } +SET_AWAY_MODE_SCHEMA = vol.Schema({ + vol.Optional(ATTR_ENTITY_ID): cv.entity_ids, + vol.Required(ATTR_AWAY_MODE): cv.boolean, +}) +SET_TEMPERATURE_SCHEMA = vol.Schema({ + vol.Optional(ATTR_ENTITY_ID): cv.entity_ids, + vol.Required(ATTR_TEMPERATURE): vol.Coerce(float), +}) +SET_FAN_MODE_SCHEMA = vol.Schema({ + vol.Optional(ATTR_ENTITY_ID): cv.entity_ids, + vol.Required(ATTR_FAN): cv.boolean, +}) + def set_away_mode(hass, away_mode, entity_id=None): """Turn all or specified thermostat away mode on.""" @@ -97,13 +112,7 @@ def setup(hass, config): """Set away mode on target thermostats.""" target_thermostats = component.extract_from_service(service) - away_mode = service.data.get(ATTR_AWAY_MODE) - - if away_mode is None: - _LOGGER.error( - "Received call to %s without attribute %s", - SERVICE_SET_AWAY_MODE, ATTR_AWAY_MODE) - return + away_mode = service.data[ATTR_AWAY_MODE] for thermostat in target_thermostats: if away_mode: @@ -115,20 +124,14 @@ def setup(hass, config): hass.services.register( DOMAIN, SERVICE_SET_AWAY_MODE, away_mode_set_service, - descriptions.get(SERVICE_SET_AWAY_MODE)) + descriptions.get(SERVICE_SET_AWAY_MODE), + schema=SET_AWAY_MODE_SCHEMA) def temperature_set_service(service): """Set temperature on the target thermostats.""" target_thermostats = component.extract_from_service(service) - temperature = util.convert( - service.data.get(ATTR_TEMPERATURE), float) - - if temperature is None: - _LOGGER.error( - "Received call to %s without attribute %s", - SERVICE_SET_TEMPERATURE, ATTR_TEMPERATURE) - return + temperature = service.data[ATTR_TEMPERATURE] for thermostat in target_thermostats: thermostat.set_temperature(convert( @@ -139,19 +142,14 @@ def setup(hass, config): hass.services.register( DOMAIN, SERVICE_SET_TEMPERATURE, temperature_set_service, - descriptions.get(SERVICE_SET_TEMPERATURE)) + descriptions.get(SERVICE_SET_TEMPERATURE), + schema=SET_TEMPERATURE_SCHEMA) def fan_mode_set_service(service): """Set fan mode on target thermostats.""" target_thermostats = component.extract_from_service(service) - fan_mode = service.data.get(ATTR_FAN) - - if fan_mode is None: - _LOGGER.error( - "Received call to %s without attribute %s", - SERVICE_SET_FAN_MODE, ATTR_FAN) - return + fan_mode = service.data[ATTR_FAN] for thermostat in target_thermostats: if fan_mode: @@ -163,7 +161,8 @@ def setup(hass, config): hass.services.register( DOMAIN, SERVICE_SET_FAN_MODE, fan_mode_set_service, - descriptions.get(SERVICE_SET_FAN_MODE)) + descriptions.get(SERVICE_SET_FAN_MODE), + schema=SET_FAN_MODE_SCHEMA) return True From 1deaf2fe8fda33f67229a2337c317a80146e770b Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Tue, 12 Apr 2016 00:37:42 -0400 Subject: [PATCH 061/114] Service validation for switch component. --- homeassistant/components/switch/__init__.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/switch/__init__.py b/homeassistant/components/switch/__init__.py index d807668fb73..8bd0585ff0c 100644 --- a/homeassistant/components/switch/__init__.py +++ b/homeassistant/components/switch/__init__.py @@ -8,10 +8,13 @@ from datetime import timedelta import logging import os +import voluptuous as vol + from homeassistant.config import load_yaml_config_file from homeassistant.helpers.entity_component import EntityComponent from homeassistant.helpers.entity import ToggleEntity from homeassistant.helpers.config_validation import PLATFORM_SCHEMA # noqa +import homeassistant.helpers.config_validation as cv from homeassistant.const import ( STATE_ON, SERVICE_TURN_ON, SERVICE_TURN_OFF, SERVICE_TOGGLE, ATTR_ENTITY_ID) @@ -50,6 +53,10 @@ PROP_TO_ATTR = { 'today_power_mw': ATTR_TODAY_MWH, } +SWITCH_SERVICE_SCHEMA = vol.Schema({ + vol.Optional(ATTR_ENTITY_ID): cv.entity_ids, +}) + _LOGGER = logging.getLogger(__name__) @@ -102,11 +109,14 @@ def setup(hass, config): descriptions = load_yaml_config_file( os.path.join(os.path.dirname(__file__), 'services.yaml')) hass.services.register(DOMAIN, SERVICE_TURN_OFF, handle_switch_service, - descriptions.get(SERVICE_TURN_OFF)) + descriptions.get(SERVICE_TURN_OFF), + schema=SWITCH_SERVICE_SCHEMA) hass.services.register(DOMAIN, SERVICE_TURN_ON, handle_switch_service, - descriptions.get(SERVICE_TURN_ON)) + descriptions.get(SERVICE_TURN_ON), + schema=SWITCH_SERVICE_SCHEMA) hass.services.register(DOMAIN, SERVICE_TOGGLE, handle_switch_service, - descriptions.get(SERVICE_TOGGLE)) + descriptions.get(SERVICE_TOGGLE), + schema=SWITCH_SERVICE_SCHEMA) return True From d90f31bf6e98a9b3ba8b766c07a1ec9af63fdbbd Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Tue, 12 Apr 2016 00:52:39 -0400 Subject: [PATCH 062/114] Config and service validation for shell_command component. --- homeassistant/components/shell_command.py | 28 +++++++++++------------ tests/components/test_shell_command.py | 26 +++++++++++---------- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/homeassistant/components/shell_command.py b/homeassistant/components/shell_command.py index b2ee7fa4314..88df938d38c 100644 --- a/homeassistant/components/shell_command.py +++ b/homeassistant/components/shell_command.py @@ -7,26 +7,26 @@ https://home-assistant.io/components/shell_command/ import logging import subprocess -from homeassistant.util import slugify +import voluptuous as vol + +import homeassistant.helpers.config_validation as cv DOMAIN = 'shell_command' _LOGGER = logging.getLogger(__name__) +CONFIG_SCHEMA = vol.Schema({ + DOMAIN: vol.Schema({ + cv.slug: cv.string, + }), +}, extra=vol.ALLOW_EXTRA) + +SHELL_COMMAND_SCHEMA = vol.Schema({}) + def setup(hass, config): """Setup the shell_command component.""" - conf = config.get(DOMAIN) - - if not isinstance(conf, dict): - _LOGGER.error('Expected configuration to be a dictionary') - return False - - for name in conf.keys(): - if name != slugify(name): - _LOGGER.error('Invalid service name: %s. Try %s', - name, slugify(name)) - return False + conf = config.get(DOMAIN, {}) def service_handler(call): """Execute a shell command service.""" @@ -38,6 +38,6 @@ def setup(hass, config): _LOGGER.exception('Error running command') for name in conf.keys(): - hass.services.register(DOMAIN, name, service_handler) - + hass.services.register(DOMAIN, name, service_handler, + schema=SHELL_COMMAND_SCHEMA) return True diff --git a/tests/components/test_shell_command.py b/tests/components/test_shell_command.py index f899411356d..a313a41b66a 100644 --- a/tests/components/test_shell_command.py +++ b/tests/components/test_shell_command.py @@ -5,6 +5,7 @@ import unittest from unittest.mock import patch from subprocess import SubprocessError +from homeassistant.bootstrap import _setup_component from homeassistant.components import shell_command from tests.common import get_test_home_assistant @@ -25,11 +26,11 @@ class TestShellCommand(unittest.TestCase): """Test if able to call a configured service.""" with tempfile.TemporaryDirectory() as tempdirname: path = os.path.join(tempdirname, 'called.txt') - self.assertTrue(shell_command.setup(self.hass, { - 'shell_command': { + assert _setup_component(self.hass, shell_command.DOMAIN, { + shell_command.DOMAIN: { 'test_service': "date > {}".format(path) } - })) + }) self.hass.services.call('shell_command', 'test_service', blocking=True) @@ -38,16 +39,17 @@ class TestShellCommand(unittest.TestCase): def test_config_not_dict(self): """Test if config is not a dict.""" - self.assertFalse(shell_command.setup(self.hass, { - 'shell_command': ['some', 'weird', 'list'] - })) + assert not _setup_component(self.hass, shell_command.DOMAIN, { + shell_command.DOMAIN: ['some', 'weird', 'list'] + }) def test_config_not_valid_service_names(self): """Test if config contains invalid service names.""" - self.assertFalse(shell_command.setup(self.hass, { - 'shell_command': { + assert not _setup_component(self.hass, shell_command.DOMAIN, { + shell_command.DOMAIN: { 'this is invalid because space': 'touch bla.txt' - }})) + } + }) @patch('homeassistant.components.shell_command.subprocess.call', side_effect=SubprocessError) @@ -56,11 +58,11 @@ class TestShellCommand(unittest.TestCase): """Test subprocess.""" with tempfile.TemporaryDirectory() as tempdirname: path = os.path.join(tempdirname, 'called.txt') - self.assertTrue(shell_command.setup(self.hass, { - 'shell_command': { + assert _setup_component(self.hass, shell_command.DOMAIN, { + shell_command.DOMAIN: { 'test_service': "touch {}".format(path) } - })) + }) self.hass.services.call('shell_command', 'test_service', blocking=True) From 567d1065b2602db0ae4385d0359c9ae4033b4e11 Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Tue, 12 Apr 2016 01:26:21 -0400 Subject: [PATCH 063/114] Service validation for script component. --- homeassistant/components/script.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/script.py b/homeassistant/components/script.py index 3dde6f1690e..c19e614f19d 100644 --- a/homeassistant/components/script.py +++ b/homeassistant/components/script.py @@ -109,6 +109,11 @@ CONFIG_SCHEMA = vol.Schema({ vol.Required(DOMAIN): {cv.slug: _SCRIPT_ENTRY_SCHEMA} }, extra=vol.ALLOW_EXTRA) +SCRIPT_SERVICE_SCHEMA = vol.Schema({}) +SCRIPT_TURN_ONOFF_SCHEMA = vol.Schema({ + vol.Optional(ATTR_ENTITY_ID): cv.entity_ids, +}) + def is_on(hass, entity_id): """Return if the switch is on based on the statemachine.""" @@ -149,7 +154,8 @@ def setup(hass, config): alias = cfg.get(CONF_ALIAS, object_id) script = Script(object_id, alias, cfg[CONF_SEQUENCE]) component.add_entities((script,)) - hass.services.register(DOMAIN, object_id, service_handler) + hass.services.register(DOMAIN, object_id, service_handler, + schema=SCRIPT_SERVICE_SCHEMA) def turn_on_service(service): """Call a service to turn script on.""" @@ -168,10 +174,12 @@ def setup(hass, config): for script in component.extract_from_service(service): script.toggle() - hass.services.register(DOMAIN, SERVICE_TURN_ON, turn_on_service) - hass.services.register(DOMAIN, SERVICE_TURN_OFF, turn_off_service) - hass.services.register(DOMAIN, SERVICE_TOGGLE, toggle_service) - + hass.services.register(DOMAIN, SERVICE_TURN_ON, turn_on_service, + schema=SCRIPT_TURN_ONOFF_SCHEMA) + hass.services.register(DOMAIN, SERVICE_TURN_OFF, turn_off_service, + schema=SCRIPT_TURN_ONOFF_SCHEMA) + hass.services.register(DOMAIN, SERVICE_TOGGLE, toggle_service, + schema=SCRIPT_TURN_ONOFF_SCHEMA) return True From ad6f5d3b1d203aab86de74a87a02249544b5756e Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Tue, 12 Apr 2016 02:01:22 -0400 Subject: [PATCH 064/114] Service validation for scene component. --- homeassistant/components/scene/__init__.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/scene/__init__.py b/homeassistant/components/scene/__init__.py index 03bb7c265c3..5ac7a2d9c86 100644 --- a/homeassistant/components/scene/__init__.py +++ b/homeassistant/components/scene/__init__.py @@ -7,9 +7,12 @@ https://home-assistant.io/components/scene/ import logging from collections import namedtuple +import voluptuous as vol + from homeassistant.const import ( ATTR_ENTITY_ID, SERVICE_TURN_ON, CONF_PLATFORM) from homeassistant.helpers import extract_domain_configs +import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity_component import EntityComponent @@ -19,6 +22,10 @@ STATE = 'scening' CONF_ENTITIES = "entities" +SCENE_SERVICE_SCHEMA = vol.Schema({ + vol.Optional(ATTR_ENTITY_ID): cv.entity_ids, +}) + SceneConfig = namedtuple('SceneConfig', ['name', 'states']) @@ -61,7 +68,8 @@ def setup(hass, config): for scene in target_scenes: scene.activate() - hass.services.register(DOMAIN, SERVICE_TURN_ON, handle_scene_service) + hass.services.register(DOMAIN, SERVICE_TURN_ON, handle_scene_service, + schema=SCENE_SERVICE_SCHEMA) return True From 40e36126bcbcfe859ac70540a462163f5b32cb78 Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Tue, 12 Apr 2016 02:25:21 -0400 Subject: [PATCH 065/114] Service validation for rollershutter component. --- .../components/rollershutter/__init__.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/rollershutter/__init__.py b/homeassistant/components/rollershutter/__init__.py index 5c90aa99fe2..98bee419802 100644 --- a/homeassistant/components/rollershutter/__init__.py +++ b/homeassistant/components/rollershutter/__init__.py @@ -7,10 +7,13 @@ https://home-assistant.io/components/rollershutter/ import os import logging +import voluptuous as vol + from homeassistant.config import load_yaml_config_file from homeassistant.helpers.entity_component import EntityComponent from homeassistant.helpers.entity import Entity from homeassistant.helpers.config_validation import PLATFORM_SCHEMA # noqa +import homeassistant.helpers.config_validation as cv from homeassistant.components import group from homeassistant.const import ( SERVICE_MOVE_UP, SERVICE_MOVE_DOWN, SERVICE_STOP, @@ -33,6 +36,10 @@ _LOGGER = logging.getLogger(__name__) ATTR_CURRENT_POSITION = 'current_position' +ROLLERSHUTTER_SERVICE_SCHEMA = vol.Schema({ + vol.Optional(ATTR_ENTITY_ID): cv.entity_ids, +}) + def is_open(hass, entity_id=None): """Return if the roller shutter is open based on the statemachine.""" @@ -85,14 +92,16 @@ def setup(hass, config): hass.services.register(DOMAIN, SERVICE_MOVE_UP, handle_rollershutter_service, - descriptions.get(SERVICE_MOVE_UP)) + descriptions.get(SERVICE_MOVE_UP), + schema=ROLLERSHUTTER_SERVICE_SCHEMA) hass.services.register(DOMAIN, SERVICE_MOVE_DOWN, handle_rollershutter_service, - descriptions.get(SERVICE_MOVE_DOWN)) + descriptions.get(SERVICE_MOVE_DOWN), + schema=ROLLERSHUTTER_SERVICE_SCHEMA) hass.services.register(DOMAIN, SERVICE_STOP, handle_rollershutter_service, - descriptions.get(SERVICE_STOP)) - + descriptions.get(SERVICE_STOP), + schema=ROLLERSHUTTER_SERVICE_SCHEMA) return True From 7ffc254a8776ad7b396a51f2888e76d22ac9e0ca Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Tue, 12 Apr 2016 02:51:51 -0400 Subject: [PATCH 066/114] Service validation for notify component. --- homeassistant/components/notify/__init__.py | 22 ++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/homeassistant/components/notify/__init__.py b/homeassistant/components/notify/__init__.py index 5be2bb1be64..4dacfcb350e 100644 --- a/homeassistant/components/notify/__init__.py +++ b/homeassistant/components/notify/__init__.py @@ -8,11 +8,13 @@ from functools import partial import logging import os +import voluptuous as vol + import homeassistant.bootstrap as bootstrap from homeassistant.config import load_yaml_config_file from homeassistant.helpers import config_per_platform, template from homeassistant.helpers.config_validation import PLATFORM_SCHEMA # noqa - +import homeassistant.helpers.config_validation as cv from homeassistant.const import CONF_NAME DOMAIN = "notify" @@ -32,6 +34,13 @@ ATTR_DATA = 'data' SERVICE_NOTIFY = "notify" +NOTIFY_SERVICE_SCHEMA = vol.Schema({ + vol.Required(ATTR_MESSAGE): cv.template, + vol.Optional(ATTR_TITLE, default=ATTR_TITLE_DEFAULT): cv.string, + vol.Optional(ATTR_TARGET): cv.string, + vol.Optional(ATTR_DATA): dict, # nobody seems to be using this (yet) +}) + _LOGGER = logging.getLogger(__name__) @@ -71,13 +80,7 @@ def setup(hass, config): def notify_message(notify_service, call): """Handle sending notification message service calls.""" - message = call.data.get(ATTR_MESSAGE) - - if message is None: - _LOGGER.error( - 'Received call to %s without attribute %s', - call.service, ATTR_MESSAGE) - return + message = call.data[ATTR_MESSAGE] title = template.render( hass, call.data.get(ATTR_TITLE, ATTR_TITLE_DEFAULT)) @@ -91,7 +94,8 @@ def setup(hass, config): service_call_handler = partial(notify_message, notify_service) service_notify = p_config.get(CONF_NAME, SERVICE_NOTIFY) hass.services.register(DOMAIN, service_notify, service_call_handler, - descriptions.get(SERVICE_NOTIFY)) + descriptions.get(SERVICE_NOTIFY), + schema=NOTIFY_SERVICE_SCHEMA) success = True return success From d6f31239372f608721757ffdb55085fc771bd8e7 Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Tue, 12 Apr 2016 21:01:35 -0400 Subject: [PATCH 067/114] Service validation for logbook component. --- homeassistant/components/logbook.py | 24 ++++++++++++++++-------- tests/components/test_logbook.py | 4 ++-- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/logbook.py b/homeassistant/components/logbook.py index d26b3373cb8..98740388cd5 100644 --- a/homeassistant/components/logbook.py +++ b/homeassistant/components/logbook.py @@ -9,6 +9,8 @@ import re from datetime import timedelta from itertools import groupby +import voluptuous as vol + import homeassistant.util.dt as dt_util from homeassistant.components import recorder, sun from homeassistant.const import ( @@ -18,6 +20,7 @@ from homeassistant.core import DOMAIN as HA_DOMAIN from homeassistant.core import State from homeassistant.helpers.entity import split_entity_id from homeassistant.helpers import template +import homeassistant.helpers.config_validation as cv DOMAIN = "logbook" DEPENDENCIES = ['recorder', 'http'] @@ -39,6 +42,13 @@ ATTR_MESSAGE = 'message' ATTR_DOMAIN = 'domain' ATTR_ENTITY_ID = 'entity_id' +LOG_MESSAGE_SCHEMA = vol.Schema({ + vol.Required(ATTR_NAME): cv.string, + vol.Required(ATTR_MESSAGE): cv.string, + vol.Optional(ATTR_DOMAIN): cv.slug, + vol.Optional(ATTR_ENTITY_ID): cv.entity_id, +}) + def log_entry(hass, name, message, domain=None, entity_id=None): """Add an entry to the logbook.""" @@ -58,19 +68,17 @@ def setup(hass, config): """Listen for download events to download files.""" def log_message(service): """Handle sending notification message service calls.""" - message = service.data.get(ATTR_MESSAGE) - name = service.data.get(ATTR_NAME) - domain = service.data.get(ATTR_DOMAIN, None) - entity_id = service.data.get(ATTR_ENTITY_ID, None) - - if not message or not name: - return + message = service.data[ATTR_MESSAGE] + name = service.data[ATTR_NAME] + domain = service.data.get(ATTR_DOMAIN) + entity_id = service.data.get(ATTR_ENTITY_ID) message = template.render(hass, message) log_entry(hass, name, message, domain, entity_id) hass.http.register_path('GET', URL_LOGBOOK, _handle_get_logbook) - hass.services.register(DOMAIN, 'log', log_message) + hass.services.register(DOMAIN, 'log', log_message, + schema=LOG_MESSAGE_SCHEMA) return True diff --git a/tests/components/test_logbook.py b/tests/components/test_logbook.py index d27865f4402..b7e95ad7eed 100644 --- a/tests/components/test_logbook.py +++ b/tests/components/test_logbook.py @@ -37,7 +37,7 @@ class TestComponentHistory(unittest.TestCase): logbook.ATTR_NAME: 'Alarm', logbook.ATTR_MESSAGE: 'is triggered', logbook.ATTR_DOMAIN: 'switch', - logbook.ATTR_ENTITY_ID: 'test_switch' + logbook.ATTR_ENTITY_ID: 'switch.test_switch' }, True) self.hass.pool.block_till_done() @@ -48,7 +48,7 @@ class TestComponentHistory(unittest.TestCase): self.assertEqual('is triggered', last_call.data.get( logbook.ATTR_MESSAGE)) self.assertEqual('switch', last_call.data.get(logbook.ATTR_DOMAIN)) - self.assertEqual('test_switch', last_call.data.get( + self.assertEqual('switch.test_switch', last_call.data.get( logbook.ATTR_ENTITY_ID)) def test_service_call_create_log_book_entry_no_message(self): From 5c520b0d35dd8e894fdedaad3e19ae26c7e31348 Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Tue, 12 Apr 2016 22:01:53 -0400 Subject: [PATCH 068/114] Service validation for lock component. --- homeassistant/components/lock/__init__.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/lock/__init__.py b/homeassistant/components/lock/__init__.py index 821e2e3da33..299c5fbb778 100644 --- a/homeassistant/components/lock/__init__.py +++ b/homeassistant/components/lock/__init__.py @@ -8,10 +8,13 @@ from datetime import timedelta import logging import os +import voluptuous as vol + from homeassistant.config import load_yaml_config_file from homeassistant.helpers.entity_component import EntityComponent from homeassistant.helpers.entity import Entity from homeassistant.helpers.config_validation import PLATFORM_SCHEMA # noqa +import homeassistant.helpers.config_validation as cv from homeassistant.const import ( ATTR_CODE, ATTR_CODE_FORMAT, ATTR_ENTITY_ID, STATE_LOCKED, STATE_UNLOCKED, STATE_UNKNOWN, SERVICE_LOCK, SERVICE_UNLOCK) @@ -33,6 +36,11 @@ DISCOVERY_PLATFORMS = { verisure.DISCOVER_LOCKS: 'verisure' } +LOCK_SERVICE_SCHEMA = vol.Schema({ + vol.Optional(ATTR_ENTITY_ID): cv.entity_ids, + vol.Optional(ATTR_CODE): cv.string, +}) + _LOGGER = logging.getLogger(__name__) @@ -75,10 +83,7 @@ def setup(hass, config): """Handle calls to the lock services.""" target_locks = component.extract_from_service(service) - if ATTR_CODE not in service.data: - code = None - else: - code = service.data[ATTR_CODE] + code = service.data.get(ATTR_CODE) for item in target_locks: if service.service == SERVICE_LOCK: @@ -92,10 +97,11 @@ def setup(hass, config): descriptions = load_yaml_config_file( os.path.join(os.path.dirname(__file__), 'services.yaml')) hass.services.register(DOMAIN, SERVICE_UNLOCK, handle_lock_service, - descriptions.get(SERVICE_UNLOCK)) + descriptions.get(SERVICE_UNLOCK), + schema=LOCK_SERVICE_SCHEMA) hass.services.register(DOMAIN, SERVICE_LOCK, handle_lock_service, - descriptions.get(SERVICE_LOCK)) - + descriptions.get(SERVICE_LOCK), + schema=LOCK_SERVICE_SCHEMA) return True From 8b40346db33ae76b48d79e4552d5b3036230e03c Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Tue, 12 Apr 2016 22:13:40 -0400 Subject: [PATCH 069/114] Service validation for keyboard component. --- homeassistant/components/keyboard.py | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/keyboard.py b/homeassistant/components/keyboard.py index eb801fae252..1a33b7dc082 100644 --- a/homeassistant/components/keyboard.py +++ b/homeassistant/components/keyboard.py @@ -4,6 +4,8 @@ Provides functionality to emulate keyboard presses on host machine. For more details about this component, please refer to the documentation at https://home-assistant.io/components/keyboard/ """ +import voluptuous as vol + from homeassistant.const import ( SERVICE_MEDIA_NEXT_TRACK, SERVICE_MEDIA_PLAY_PAUSE, SERVICE_MEDIA_PREVIOUS_TRACK, SERVICE_VOLUME_DOWN, SERVICE_VOLUME_MUTE, @@ -12,6 +14,8 @@ from homeassistant.const import ( DOMAIN = "keyboard" REQUIREMENTS = ['pyuserinput==0.1.9'] +TAP_KEY_SCHEMA = vol.Schema({}) + def volume_up(hass): """Press the keyboard button for volume up.""" @@ -52,26 +56,31 @@ def setup(hass, config): hass.services.register(DOMAIN, SERVICE_VOLUME_UP, lambda service: - keyboard.tap_key(keyboard.volume_up_key)) + keyboard.tap_key(keyboard.volume_up_key), + schema=TAP_KEY_SCHEMA) hass.services.register(DOMAIN, SERVICE_VOLUME_DOWN, lambda service: - keyboard.tap_key(keyboard.volume_down_key)) + keyboard.tap_key(keyboard.volume_down_key), + schema=TAP_KEY_SCHEMA) hass.services.register(DOMAIN, SERVICE_VOLUME_MUTE, lambda service: - keyboard.tap_key(keyboard.volume_mute_key)) + keyboard.tap_key(keyboard.volume_mute_key), + schema=TAP_KEY_SCHEMA) hass.services.register(DOMAIN, SERVICE_MEDIA_PLAY_PAUSE, lambda service: - keyboard.tap_key(keyboard.media_play_pause_key)) + keyboard.tap_key(keyboard.media_play_pause_key), + schema=TAP_KEY_SCHEMA) hass.services.register(DOMAIN, SERVICE_MEDIA_NEXT_TRACK, lambda service: - keyboard.tap_key(keyboard.media_next_track_key)) + keyboard.tap_key(keyboard.media_next_track_key), + schema=TAP_KEY_SCHEMA) hass.services.register(DOMAIN, SERVICE_MEDIA_PREVIOUS_TRACK, lambda service: - keyboard.tap_key(keyboard.media_prev_track_key)) - + keyboard.tap_key(keyboard.media_prev_track_key), + schema=TAP_KEY_SCHEMA) return True From 620d7a92f0f9e6d1a42c8dd2b16c74f704782366 Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Tue, 12 Apr 2016 22:52:14 -0400 Subject: [PATCH 070/114] Service validation for input_slider component. --- homeassistant/components/input_slider.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/input_slider.py b/homeassistant/components/input_slider.py index bef270f1387..a142fb364c7 100644 --- a/homeassistant/components/input_slider.py +++ b/homeassistant/components/input_slider.py @@ -6,7 +6,10 @@ at https://home-assistant.io/components/input_slider/ """ import logging +import voluptuous as vol + from homeassistant.const import ATTR_ENTITY_ID +import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity_component import EntityComponent from homeassistant.util import slugify @@ -29,6 +32,11 @@ ATTR_STEP = 'step' SERVICE_SELECT_VALUE = 'select_value' +SERVICE_SELECT_VALUE_SCHEMA = vol.Schema({ + vol.Optional(ATTR_ENTITY_ID): cv.entity_ids, + vol.Required(ATTR_VALUE): vol.Coerce(int), +}) + def select_value(hass, entity_id, value): """Set input_slider to value.""" @@ -81,10 +89,11 @@ def setup(hass, config): target_inputs = component.extract_from_service(call) for input_slider in target_inputs: - input_slider.select_value(call.data.get(ATTR_VALUE)) + input_slider.select_value(call.data[ATTR_VALUE]) hass.services.register(DOMAIN, SERVICE_SELECT_VALUE, - select_value_service) + select_value_service, + schema=SERVICE_SELECT_VALUE_SCHEMA) component.add_entities(entities) From bfdbbbddac02219019091ffa6546a21632a5016e Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Tue, 12 Apr 2016 22:57:18 -0400 Subject: [PATCH 071/114] Service validation for input_select component. --- homeassistant/components/input_select.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/input_select.py b/homeassistant/components/input_select.py index e7c6e280386..15b4c398287 100644 --- a/homeassistant/components/input_select.py +++ b/homeassistant/components/input_select.py @@ -6,7 +6,10 @@ at https://home-assistant.io/components/input_select/ """ import logging +import voluptuous as vol + from homeassistant.const import ATTR_ENTITY_ID +import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity_component import EntityComponent from homeassistant.util import slugify @@ -25,6 +28,11 @@ ATTR_OPTIONS = 'options' SERVICE_SELECT_OPTION = 'select_option' +SERVICE_SELECT_OPTION_SCHEMA = vol.Schema({ + vol.Optional(ATTR_ENTITY_ID): cv.entity_ids, + vol.Required(ATTR_OPTION): cv.string, +}) + def select_option(hass, entity_id, option): """Set input_select to False.""" @@ -79,10 +87,11 @@ def setup(hass, config): target_inputs = component.extract_from_service(call) for input_select in target_inputs: - input_select.select_option(call.data.get(ATTR_OPTION)) + input_select.select_option(call.data[ATTR_OPTION]) hass.services.register(DOMAIN, SERVICE_SELECT_OPTION, - select_option_service) + select_option_service, + schema=SERVICE_SELECT_OPTION_SCHEMA) component.add_entities(entities) From 7e0d9bc7095d9ba47def6f54f2970b35e7bf30ec Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Tue, 12 Apr 2016 23:04:06 -0400 Subject: [PATCH 072/114] Service validation for input_boolean component. --- homeassistant/components/input_boolean.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/input_boolean.py b/homeassistant/components/input_boolean.py index 75d5d940f47..8702fd6eae2 100644 --- a/homeassistant/components/input_boolean.py +++ b/homeassistant/components/input_boolean.py @@ -6,8 +6,11 @@ at https://home-assistant.io/components/input_boolean/ """ import logging +import voluptuous as vol + from homeassistant.const import ( ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_ON, STATE_ON) +import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import ToggleEntity from homeassistant.helpers.entity_component import EntityComponent from homeassistant.util import slugify @@ -22,6 +25,10 @@ CONF_NAME = "name" CONF_INITIAL = "initial" CONF_ICON = "icon" +TOGGLE_SERVICE_SCHEMA = vol.Schema({ + vol.Optional(ATTR_ENTITY_ID): cv.entity_ids, +}) + def is_on(hass, entity_id): """Test if input_boolean is True.""" @@ -75,8 +82,10 @@ def setup(hass, config): else: input_b.turn_off() - hass.services.register(DOMAIN, SERVICE_TURN_OFF, toggle_service) - hass.services.register(DOMAIN, SERVICE_TURN_ON, toggle_service) + hass.services.register(DOMAIN, SERVICE_TURN_OFF, toggle_service, + schema=TOGGLE_SERVICE_SCHEMA) + hass.services.register(DOMAIN, SERVICE_TURN_ON, toggle_service, + schema=TOGGLE_SERVICE_SCHEMA) component.add_entities(entities) From 49b002dc53c5e48b8ee8bf56bff99876838daa17 Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Tue, 12 Apr 2016 23:08:20 -0400 Subject: [PATCH 073/114] Service validation for ifttt component. --- homeassistant/components/ifttt.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/ifttt.py b/homeassistant/components/ifttt.py index 6694bb5d2ee..a30ef184d7e 100644 --- a/homeassistant/components/ifttt.py +++ b/homeassistant/components/ifttt.py @@ -7,8 +7,10 @@ https://home-assistant.io/components/ifttt/ import logging import requests +import voluptuous as vol from homeassistant.helpers import validate_config +import homeassistant.helpers.config_validation as cv _LOGGER = logging.getLogger(__name__) @@ -23,6 +25,13 @@ ATTR_VALUE3 = 'value3' REQUIREMENTS = ['pyfttt==0.3'] +SERVICE_TRIGGER_SCHEMA = vol.Schema({ + vol.Required(ATTR_EVENT): cv.string, + vol.Optional(ATTR_VALUE1): cv.string, + vol.Optional(ATTR_VALUE2): cv.string, + vol.Optional(ATTR_VALUE3): cv.string, +}) + def trigger(hass, event, value1=None, value2=None, value3=None): """Trigger a Maker IFTTT recipe.""" @@ -44,12 +53,10 @@ def setup(hass, config): def trigger_service(call): """Handle IFTTT trigger service calls.""" - event = call.data.get(ATTR_EVENT) + event = call.data[ATTR_EVENT] value1 = call.data.get(ATTR_VALUE1) value2 = call.data.get(ATTR_VALUE2) value3 = call.data.get(ATTR_VALUE3) - if event is None: - return try: import pyfttt as pyfttt @@ -57,6 +64,7 @@ def setup(hass, config): except requests.exceptions.RequestException: _LOGGER.exception("Error communicating with IFTTT") - hass.services.register(DOMAIN, SERVICE_TRIGGER, trigger_service) + hass.services.register(DOMAIN, SERVICE_TRIGGER, trigger_service, + schema=SERVICE_TRIGGER_SCHEMA) return True From 652fe7e0f2991ff5aa8e17bb4a1d2f61ce5a29ca Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Tue, 12 Apr 2016 23:13:24 -0400 Subject: [PATCH 074/114] Service validation for garage_door component. --- homeassistant/components/garage_door/__init__.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/garage_door/__init__.py b/homeassistant/components/garage_door/__init__.py index 736949e474e..30d9a5e2e0b 100644 --- a/homeassistant/components/garage_door/__init__.py +++ b/homeassistant/components/garage_door/__init__.py @@ -7,10 +7,13 @@ at https://home-assistant.io/components/garage_door/ import logging import os +import voluptuous as vol + from homeassistant.config import load_yaml_config_file from homeassistant.helpers.entity_component import EntityComponent from homeassistant.helpers.entity import Entity from homeassistant.helpers.config_validation import PLATFORM_SCHEMA # noqa +import homeassistant.helpers.config_validation as cv from homeassistant.const import ( STATE_CLOSED, STATE_OPEN, STATE_UNKNOWN, SERVICE_CLOSE, SERVICE_OPEN, ATTR_ENTITY_ID) @@ -29,6 +32,10 @@ DISCOVERY_PLATFORMS = { wink.DISCOVER_GARAGE_DOORS: 'wink' } +GARAGE_DOOR_SERVICE_SCHEMA = vol.Schema({ + vol.Optional(ATTR_ENTITY_ID): cv.entity_ids, +}) + _LOGGER = logging.getLogger(__name__) @@ -73,10 +80,11 @@ def setup(hass, config): descriptions = load_yaml_config_file( os.path.join(os.path.dirname(__file__), 'services.yaml')) hass.services.register(DOMAIN, SERVICE_OPEN, handle_garage_door_service, - descriptions.get(SERVICE_OPEN)) + descriptions.get(SERVICE_OPEN), + schema=GARAGE_DOOR_SERVICE_SCHEMA) hass.services.register(DOMAIN, SERVICE_CLOSE, handle_garage_door_service, - descriptions.get(SERVICE_CLOSE)) - + descriptions.get(SERVICE_CLOSE), + schema=GARAGE_DOOR_SERVICE_SCHEMA) return True From 003bd24976e9ded0109a2d0914ec82c56d10c56f Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Tue, 12 Apr 2016 23:21:27 -0400 Subject: [PATCH 075/114] Service validation for downloader component. --- homeassistant/components/downloader.py | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/downloader.py b/homeassistant/components/downloader.py index c425d9cbb23..e05c617bcf0 100644 --- a/homeassistant/components/downloader.py +++ b/homeassistant/components/downloader.py @@ -10,8 +10,10 @@ import re import threading import requests +import voluptuous as vol from homeassistant.helpers import validate_config +import homeassistant.helpers.config_validation as cv from homeassistant.util import sanitize_filename DOMAIN = "downloader" @@ -21,6 +23,11 @@ SERVICE_DOWNLOAD_FILE = "download_file" ATTR_URL = "url" ATTR_SUBDIR = "subdir" +SERVICE_DOWNLOAD_FILE_SCHEMA = vol.Schema({ + vol.Required(ATTR_URL): vol.Url, + vol.Optional(ATTR_SUBDIR): cv.string, +}) + CONF_DOWNLOAD_DIR = 'download_dir' @@ -48,10 +55,6 @@ def setup(hass, config): def download_file(service): """Start thread to download file specified in the URL.""" - if ATTR_URL not in service.data: - logger.error("Service called but 'url' parameter not specified.") - return - def do_download(): """Download the file.""" try: @@ -127,7 +130,7 @@ def setup(hass, config): threading.Thread(target=do_download).start() - hass.services.register(DOMAIN, SERVICE_DOWNLOAD_FILE, - download_file) + hass.services.register(DOMAIN, SERVICE_DOWNLOAD_FILE, download_file, + schema=SERVICE_DOWNLOAD_FILE_SCHEMA) return True From 7c9729b9c1d088ee504ee83cda7ee68ed6794ef1 Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Wed, 13 Apr 2016 12:48:39 -0400 Subject: [PATCH 076/114] Service validation for conversation component. --- homeassistant/components/conversation.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/conversation.py b/homeassistant/components/conversation.py index 11e018846c2..dc8446412c4 100644 --- a/homeassistant/components/conversation.py +++ b/homeassistant/components/conversation.py @@ -8,9 +8,12 @@ import logging import re import warnings +import voluptuous as vol + from homeassistant import core from homeassistant.const import ( ATTR_ENTITY_ID, SERVICE_TURN_OFF, SERVICE_TURN_ON) +import homeassistant.helpers.config_validation as cv DOMAIN = "conversation" @@ -18,6 +21,10 @@ SERVICE_PROCESS = "process" ATTR_TEXT = "text" +SERVICE_PROCESS_SCHEMA = vol.Schema({ + vol.Required(ATTR_TEXT): vol.All(cv.string, vol.Lower), +}) + REGEX_TURN_COMMAND = re.compile(r'turn (?P(?: |\w)+) (?P\w+)') REQUIREMENTS = ['fuzzywuzzy==0.8.0'] @@ -32,11 +39,7 @@ def setup(hass, config): def process(service): """Parse text into commands.""" - if ATTR_TEXT not in service.data: - logger.error("Received process service call without a text") - return - - text = service.data[ATTR_TEXT].lower() + text = service.data[ATTR_TEXT] match = REGEX_TURN_COMMAND.match(text) if not match: @@ -67,6 +70,6 @@ def setup(hass, config): logger.error( 'Got unsupported command %s from text %s', command, text) - hass.services.register(DOMAIN, SERVICE_PROCESS, process) - + hass.services.register(DOMAIN, SERVICE_PROCESS, process, + schema=SERVICE_PROCESS_SCHEMA) return True From 5cdaee7ebbffd0b41c68effb8ff03aed77ca6854 Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Wed, 13 Apr 2016 12:57:47 -0400 Subject: [PATCH 077/114] Service validation for browser component. --- homeassistant/components/browser.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/browser.py b/homeassistant/components/browser.py index edfe1008c6e..fc78b83bd60 100644 --- a/homeassistant/components/browser.py +++ b/homeassistant/components/browser.py @@ -4,10 +4,18 @@ Provides functionality to launch a web browser on the host machine. For more details about this component, please refer to the documentation at https://home-assistant.io/components/browser/ """ +import voluptuous as vol DOMAIN = "browser" SERVICE_BROWSE_URL = "browse_url" +ATTR_URL = 'url' +ATTR_URL_DEFAULT = 'https://www.google.com' + +SERVICE_BROWSE_URL_SCHEMA = vol.Schema({ + vol.Required(ATTR_URL, default=ATTR_URL_DEFAULT): vol.Url, +}) + def setup(hass, config): """Listen for browse_url events.""" @@ -15,8 +23,7 @@ def setup(hass, config): hass.services.register(DOMAIN, SERVICE_BROWSE_URL, lambda service: - webbrowser.open( - service.data.get( - 'url', 'https://www.google.com'))) + webbrowser.open(service.data[ATTR_URL]), + schema=SERVICE_BROWSE_URL_SCHEMA) return True From 298a1c2af7fefd4e0b624da46a55de66437118e4 Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Wed, 13 Apr 2016 13:45:11 -0400 Subject: [PATCH 078/114] Service validation for alarm_control_panel component. --- .../components/alarm_control_panel/__init__.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/alarm_control_panel/__init__.py b/homeassistant/components/alarm_control_panel/__init__.py index e3bde441211..cf042abbe10 100644 --- a/homeassistant/components/alarm_control_panel/__init__.py +++ b/homeassistant/components/alarm_control_panel/__init__.py @@ -7,12 +7,15 @@ https://home-assistant.io/components/alarm_control_panel/ import logging import os +import voluptuous as vol + from homeassistant.components import verisure from homeassistant.const import ( ATTR_CODE, ATTR_CODE_FORMAT, ATTR_ENTITY_ID, SERVICE_ALARM_TRIGGER, SERVICE_ALARM_DISARM, SERVICE_ALARM_ARM_HOME, SERVICE_ALARM_ARM_AWAY) from homeassistant.config import load_yaml_config_file from homeassistant.helpers.config_validation import PLATFORM_SCHEMA # noqa +import homeassistant.helpers.config_validation as cv from homeassistant.helpers.entity import Entity from homeassistant.helpers.entity_component import EntityComponent @@ -38,6 +41,11 @@ ATTR_TO_PROPERTY = [ ATTR_CODE_FORMAT ] +ALARM_SERVICE_SCHEMA = vol.Schema({ + vol.Optional(ATTR_ENTITY_ID): cv.entity_ids, + vol.Optional(ATTR_CODE): cv.string, +}) + def setup(hass, config): """Track states and offer events for sensors.""" @@ -51,10 +59,7 @@ def setup(hass, config): """Map services to methods on Alarm.""" target_alarms = component.extract_from_service(service) - if ATTR_CODE not in service.data: - code = None - else: - code = service.data[ATTR_CODE] + code = service.data.get(ATTR_CODE) method = SERVICE_TO_METHOD[service.service] @@ -68,8 +73,8 @@ def setup(hass, config): for service in SERVICE_TO_METHOD: hass.services.register(DOMAIN, service, alarm_service_handler, - descriptions.get(service)) - + descriptions.get(service), + schema=ALARM_SERVICE_SCHEMA) return True From f1d8667d7eddae1994007c72957cf7e520b5117c Mon Sep 17 00:00:00 2001 From: Dennis Karpienski Date: Thu, 14 Apr 2016 06:13:12 +0200 Subject: [PATCH 079/114] Yamaha AVR Input Select (#1796) * added select input for yamaha * set source_list to none on init --- .../components/media_player/__init__.py | 8 +++++++ .../components/media_player/yamaha.py | 24 +++++++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/media_player/__init__.py b/homeassistant/components/media_player/__init__.py index b1c0cd8a63c..c6e4c147c1c 100644 --- a/homeassistant/components/media_player/__init__.py +++ b/homeassistant/components/media_player/__init__.py @@ -61,6 +61,7 @@ ATTR_APP_ID = 'app_id' ATTR_APP_NAME = 'app_name' ATTR_SUPPORTED_MEDIA_COMMANDS = 'supported_media_commands' ATTR_INPUT_SOURCE = 'source' +ATTR_INPUT_SOURCE_LIST = 'source_list' MEDIA_TYPE_MUSIC = 'music' MEDIA_TYPE_TVSHOW = 'tvshow' @@ -94,6 +95,7 @@ SERVICE_TO_METHOD = { SERVICE_MEDIA_PAUSE: 'media_pause', SERVICE_MEDIA_NEXT_TRACK: 'media_next_track', SERVICE_MEDIA_PREVIOUS_TRACK: 'media_previous_track', + SERVICE_SELECT_SOURCE: 'select_source' } ATTR_TO_PROPERTY = [ @@ -116,6 +118,7 @@ ATTR_TO_PROPERTY = [ ATTR_APP_NAME, ATTR_SUPPORTED_MEDIA_COMMANDS, ATTR_INPUT_SOURCE, + ATTR_INPUT_SOURCE_LIST, ] # Service call validation schemas @@ -473,6 +476,11 @@ class MediaPlayerDevice(Entity): """Name of the current input source.""" return None + @property + def source_list(self): + """List of available input sources.""" + return None + @property def supported_media_commands(self): """Flag media commands that are supported.""" diff --git a/homeassistant/components/media_player/yamaha.py b/homeassistant/components/media_player/yamaha.py index 56fd0830b84..bc943a56c70 100644 --- a/homeassistant/components/media_player/yamaha.py +++ b/homeassistant/components/media_player/yamaha.py @@ -8,13 +8,15 @@ import logging from homeassistant.components.media_player import ( SUPPORT_TURN_OFF, SUPPORT_TURN_ON, SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_SET, - MediaPlayerDevice) + SUPPORT_SELECT_SOURCE, MediaPlayerDevice) from homeassistant.const import STATE_OFF, STATE_ON + REQUIREMENTS = ['rxv==0.1.11'] + _LOGGER = logging.getLogger(__name__) SUPPORT_YAMAHA = SUPPORT_VOLUME_SET | SUPPORT_VOLUME_MUTE | \ - SUPPORT_TURN_ON | SUPPORT_TURN_OFF + SUPPORT_TURN_ON | SUPPORT_TURN_OFF | SUPPORT_SELECT_SOURCE def setup_platform(hass, config, add_devices, discovery_info=None): @@ -34,6 +36,8 @@ class YamahaDevice(MediaPlayerDevice): self._muted = False self._volume = 0 self._pwstate = STATE_OFF + self._current_source = None + self._source_list = None self.update() self._name = name @@ -45,6 +49,8 @@ class YamahaDevice(MediaPlayerDevice): self._pwstate = STATE_OFF self._muted = self._receiver.mute self._volume = (self._receiver.volume/100) + 1 + self._current_source = self._receiver.input + self._source_list = list(self._receiver.inputs().keys()) @property def name(self): @@ -66,6 +72,16 @@ class YamahaDevice(MediaPlayerDevice): """Boolean if volume is currently muted.""" return self._muted + @property + def source(self): + """Return the current input source.""" + return self._current_source + + @property + def source_list(self): + """List of available input sources.""" + return self._source_list + @property def supported_media_commands(self): """Flag of media commands that are supported.""" @@ -89,3 +105,7 @@ class YamahaDevice(MediaPlayerDevice): """Turn the media player on.""" self._receiver.on = True self._volume = (self._receiver.volume/100) + 1 + + def select_source(self, source): + """Select input source.""" + self._receiver.input = source From 8b986b0b971cb48320629115f799cdeb309a8b46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98ystein=20Hansen?= Date: Thu, 14 Apr 2016 06:22:40 +0200 Subject: [PATCH 080/114] mysensors.py Prevent sensor name mixup (#1802) Change the sensor name schema so nodes are not mixed up. The dot that was pressent before was ignored by home-assistant. Before name: eg. wall 107 New name : eg. wall 10 7 This will result in a Home Assistant Entity ID of: sensor.wall_10_7 --- homeassistant/components/mysensors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/mysensors.py b/homeassistant/components/mysensors.py index 570a59151ce..ec8976c8373 100644 --- a/homeassistant/components/mysensors.py +++ b/homeassistant/components/mysensors.py @@ -139,7 +139,7 @@ def pf_callback_factory(map_sv_types, devices, add_devices, entity_class): if key in devices: devices[key].update_ha_state(True) continue - name = '{} {}.{}'.format( + name = '{} {} {}'.format( gateway.sensors[node_id].sketch_name, node_id, child.id) if isinstance(entity_class, dict): device_class = entity_class[child.type] From 0abedd8b46a76550d4989ef501c7f5290d555e97 Mon Sep 17 00:00:00 2001 From: Alex Harvey Date: Wed, 13 Apr 2016 22:33:30 -0700 Subject: [PATCH 081/114] fix for plex not detecting plex players after power up (#1824) --- homeassistant/components/media_player/plex.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homeassistant/components/media_player/plex.py b/homeassistant/components/media_player/plex.py index b472b6c8eba..19a26862199 100644 --- a/homeassistant/components/media_player/plex.py +++ b/homeassistant/components/media_player/plex.py @@ -18,6 +18,7 @@ from homeassistant.const import ( DEVICE_DEFAULT_NAME, STATE_IDLE, STATE_OFF, STATE_PAUSED, STATE_PLAYING, STATE_UNKNOWN) from homeassistant.loader import get_component +from homeassistant.helpers.event import (track_utc_time_change) REQUIREMENTS = ['plexapi==1.1.0'] MIN_TIME_BETWEEN_SCANS = timedelta(seconds=10) @@ -113,6 +114,7 @@ def setup_plexserver(host, token, hass, add_devices_callback): plex_clients = {} plex_sessions = {} + track_utc_time_change(hass, lambda now: update_devices(), second=30) @util.Throttle(MIN_TIME_BETWEEN_SCANS, MIN_TIME_BETWEEN_FORCED_SCANS) def update_devices(): From e7520ef401ba5874f2110f9106223e31fd601032 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 14 Apr 2016 22:57:41 -0700 Subject: [PATCH 082/114] Update frontend + mdi --- .../components/frontend/mdi_version.py | 2 +- homeassistant/components/frontend/version.py | 2 +- .../frontend/www_static/frontend.html | 23 +++++++++++++++---- .../www_static/home-assistant-polymer | 2 +- .../components/frontend/www_static/mdi.html | 2 +- 5 files changed, 22 insertions(+), 9 deletions(-) diff --git a/homeassistant/components/frontend/mdi_version.py b/homeassistant/components/frontend/mdi_version.py index 87b533d9673..7ed7beb6121 100644 --- a/homeassistant/components/frontend/mdi_version.py +++ b/homeassistant/components/frontend/mdi_version.py @@ -1,2 +1,2 @@ """DO NOT MODIFY. Auto-generated by update_mdi script.""" -VERSION = "df49e6b7c930eb39b42ff1909712e95e" +VERSION = "322d37644a99e0863fd82ce7ac687545" diff --git a/homeassistant/components/frontend/version.py b/homeassistant/components/frontend/version.py index bdae83deb1a..6fa998f9002 100644 --- a/homeassistant/components/frontend/version.py +++ b/homeassistant/components/frontend/version.py @@ -1,2 +1,2 @@ """DO NOT MODIFY. Auto-generated by build_frontend script.""" -VERSION = "61e09b69c1d31580fb195a502017095a" +VERSION = "91191cb375be56ce689a38edc782875f" diff --git a/homeassistant/components/frontend/www_static/frontend.html b/homeassistant/components/frontend/www_static/frontend.html index ee7bc4655ab..14fd6ed8f73 100644 --- a/homeassistant/components/frontend/www_static/frontend.html +++ b/homeassistant/components/frontend/www_static/frontend.html @@ -3759,7 +3759,7 @@ e.bindAnimationForKeyframeEffect(this)),(this.effect instanceof window.SequenceE background-color: rgba(0, 0, 0, var(--dark-secondary-opacity)); - padding: 16px; + padding: 8px 16px; text-transform: capitalize; font-size: 14px; @@ -3797,6 +3797,10 @@ e.bindAnimationForKeyframeEffect(this)),(this.effect instanceof window.SequenceE color: var(--primary-text-color); } + paper-icon-button[disabled] { + color: var(--paper-grey-400); + } + paper-icon-button.primary { width: 56px !important; height: 56px !important; @@ -3813,7 +3817,7 @@ e.bindAnimationForKeyframeEffect(this)),(this.effect instanceof window.SequenceE [invisible] { visibility: hidden !important; - }