/******/ (function(modules) { // webpackBootstrap /******/ // The module cache /******/ var installedModules = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ /******/ // Check if module is in cache /******/ if(installedModules[moduleId]) { /******/ return installedModules[moduleId].exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = installedModules[moduleId] = { /******/ i: moduleId, /******/ l: false, /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); /******/ /******/ // Flag the module as loaded /******/ module.l = true; /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = modules; /******/ /******/ // expose the module cache /******/ __webpack_require__.c = installedModules; /******/ /******/ // define getter function for harmony exports /******/ __webpack_require__.d = function(exports, name, getter) { /******/ if(!__webpack_require__.o(exports, name)) { /******/ Object.defineProperty(exports, name, { /******/ configurable: false, /******/ enumerable: true, /******/ get: getter /******/ }); /******/ } /******/ }; /******/ /******/ // define __esModule on exports /******/ __webpack_require__.r = function(exports) { /******/ Object.defineProperty(exports, '__esModule', { value: true }); /******/ }; /******/ /******/ // getDefaultExport function for compatibility with non-harmony modules /******/ __webpack_require__.n = function(module) { /******/ var getter = module && module.__esModule ? /******/ function getDefault() { return module['default']; } : /******/ function getModuleExports() { return module; }; /******/ __webpack_require__.d(getter, 'a', getter); /******/ return getter; /******/ }; /******/ /******/ // Object.prototype.hasOwnProperty.call /******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; /******/ /******/ // __webpack_public_path__ /******/ __webpack_require__.p = ""; /******/ /******/ /******/ // Load entry module and return exports /******/ return __webpack_require__(__webpack_require__.s = "./src/entrypoints/scripts.js"); /******/ }) /************************************************************************/ /******/ ({ /***/ "../home-assistant-polymer/src/common/const.ts": /*!*****************************************************!*\ !*** ../home-assistant-polymer/src/common/const.ts ***! \*****************************************************/ /*! exports provided: DEFAULT_DOMAIN_ICON, DEFAULT_PANEL, DOMAINS_WITH_CARD, DOMAINS_WITH_MORE_INFO, DOMAINS_HIDE_MORE_INFO, DOMAINS_MORE_INFO_NO_HISTORY, STATES_OFF, DOMAINS_TOGGLE, UNIT_C, UNIT_F, DEFAULT_VIEW_ENTITY_ID */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_DOMAIN_ICON", function() { return DEFAULT_DOMAIN_ICON; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_PANEL", function() { return DEFAULT_PANEL; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOMAINS_WITH_CARD", function() { return DOMAINS_WITH_CARD; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOMAINS_WITH_MORE_INFO", function() { return DOMAINS_WITH_MORE_INFO; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOMAINS_HIDE_MORE_INFO", function() { return DOMAINS_HIDE_MORE_INFO; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOMAINS_MORE_INFO_NO_HISTORY", function() { return DOMAINS_MORE_INFO_NO_HISTORY; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "STATES_OFF", function() { return STATES_OFF; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DOMAINS_TOGGLE", function() { return DOMAINS_TOGGLE; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UNIT_C", function() { return UNIT_C; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "UNIT_F", function() { return UNIT_F; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "DEFAULT_VIEW_ENTITY_ID", function() { return DEFAULT_VIEW_ENTITY_ID; }); /** Constants to be used in the frontend. */ // Constants should be alphabetically sorted by name. // Arrays with values should be alphabetically sorted if order doesn't matter. // Each constant should have a description what it is supposed to be used for. /** Icon to use when no icon specified for domain. */ const DEFAULT_DOMAIN_ICON = "hass:bookmark"; /** Panel to show when no panel is picked. */ const DEFAULT_PANEL = "lovelace"; /** Domains that have a state card. */ const DOMAINS_WITH_CARD = ["climate", "cover", "configurator", "input_select", "input_number", "input_text", "lock", "media_player", "scene", "script", "timer", "vacuum", "water_heater", "weblink"]; /** Domains with separate more info dialog. */ const DOMAINS_WITH_MORE_INFO = ["alarm_control_panel", "automation", "camera", "climate", "configurator", "cover", "fan", "group", "history_graph", "input_datetime", "light", "lock", "media_player", "script", "sun", "updater", "vacuum", "water_heater", "weather"]; /** Domains that show no more info dialog. */ const DOMAINS_HIDE_MORE_INFO = ["input_number", "input_select", "input_text", "scene", "weblink"]; /** Domains that should have the history hidden in the more info dialog. */ const DOMAINS_MORE_INFO_NO_HISTORY = ["camera", "configurator", "history_graph", "scene"]; /** States that we consider "off". */ const STATES_OFF = ["closed", "locked", "off"]; /** Domains where we allow toggle in Lovelace. */ const DOMAINS_TOGGLE = new Set(["fan", "input_boolean", "light", "switch", "group", "automation"]); /** Temperature units. */ const UNIT_C = "°C"; const UNIT_F = "°F"; /** Entity ID of the default view. */ const DEFAULT_VIEW_ENTITY_ID = "group.default_view"; /***/ }), /***/ "../home-assistant-polymer/src/common/dom/apply_themes_on_element.ts": /*!***************************************************************************!*\ !*** ../home-assistant-polymer/src/common/dom/apply_themes_on_element.ts ***! \***************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return applyThemesOnElement; }); /** * Apply a theme to an element by setting the CSS variables on it. * * element: Element to apply theme on. * themes: HASS Theme information * localTheme: selected theme. * updateMeta: boolean if we should update the theme-color meta element. */ function applyThemesOnElement(element, themes, localTheme, updateMeta = false) { if (!element._themes) { element._themes = {}; } let themeName = themes.default_theme; if (localTheme === "default" || localTheme && themes.themes[localTheme]) { themeName = localTheme; } const styles = { ...element._themes }; if (themeName !== "default") { const theme = themes.themes[themeName]; Object.keys(theme).forEach(key => { const prefixedKey = "--" + key; element._themes[prefixedKey] = ""; styles[prefixedKey] = theme[key]; }); } if (element.updateStyles) { element.updateStyles(styles); } else if (window.ShadyCSS) { // implement updateStyles() method of Polemer elements window.ShadyCSS.styleSubtree( /** @type {!HTMLElement} */ element, styles); } if (!updateMeta) { return; } const meta = document.querySelector("meta[name=theme-color]"); if (meta) { if (!meta.hasAttribute("default-content")) { meta.setAttribute("default-content", meta.getAttribute("content")); } const themeColor = styles["--primary-color"] || meta.getAttribute("default-content"); meta.setAttribute("content", themeColor); } } /***/ }), /***/ "../home-assistant-polymer/src/common/dom/dynamic_content_updater.ts": /*!***************************************************************************!*\ !*** ../home-assistant-polymer/src/common/dom/dynamic_content_updater.ts ***! \***************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return dynamicContentUpdater; }); /** * Update root's child element to be newElementTag replacing another existing child if any. * Copy attributes into the child element. */ function dynamicContentUpdater(root, newElementTag, attributes) { const rootEl = root; let customEl; if (rootEl.lastChild && rootEl.lastChild.tagName === newElementTag) { customEl = rootEl.lastChild; } else { if (rootEl.lastChild) { rootEl.removeChild(rootEl.lastChild); } // Creating an element with upper case works fine in Chrome, but in FF it doesn't immediately // become a defined Custom Element. Polymer does that in some later pass. customEl = document.createElement(newElementTag.toLowerCase()); } if (customEl.setProperties) { customEl.setProperties(attributes); } else { // If custom element definition wasn't loaded yet - setProperties would be // missing, but no harm in setting attributes one-by-one then. Object.keys(attributes).forEach(key => { customEl[key] = attributes[key]; }); } if (customEl.parentNode === null) { rootEl.appendChild(customEl); } } /***/ }), /***/ "../home-assistant-polymer/src/common/entity/can_toggle_domain.ts": /*!************************************************************************!*\ !*** ../home-assistant-polymer/src/common/entity/can_toggle_domain.ts ***! \************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return canToggleDomain; }); function canToggleDomain(hass, domain) { const services = hass.services[domain]; if (!services) { return false; } if (domain === "lock") { return "lock" in services; } if (domain === "cover") { return "open_cover" in services; } return "turn_on" in services; } /***/ }), /***/ "../home-assistant-polymer/src/common/entity/can_toggle_state.ts": /*!***********************************************************************!*\ !*** ../home-assistant-polymer/src/common/entity/can_toggle_state.ts ***! \***********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return canToggleState; }); /* harmony import */ var _can_toggle_domain__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./can_toggle_domain */ "../home-assistant-polymer/src/common/entity/can_toggle_domain.ts"); /* harmony import */ var _compute_state_domain__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./compute_state_domain */ "../home-assistant-polymer/src/common/entity/compute_state_domain.ts"); /* harmony import */ var _supports_feature__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./supports-feature */ "../home-assistant-polymer/src/common/entity/supports-feature.ts"); function canToggleState(hass, stateObj) { const domain = Object(_compute_state_domain__WEBPACK_IMPORTED_MODULE_1__["default"])(stateObj); if (domain === "group") { return stateObj.state === "on" || stateObj.state === "off"; } if (domain === "climate") { return Object(_supports_feature__WEBPACK_IMPORTED_MODULE_2__["supportsFeature"])(stateObj, 4096); } return Object(_can_toggle_domain__WEBPACK_IMPORTED_MODULE_0__["default"])(hass, domain); } /***/ }), /***/ "../home-assistant-polymer/src/common/entity/compute_domain.ts": /*!*********************************************************************!*\ !*** ../home-assistant-polymer/src/common/entity/compute_domain.ts ***! \*********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return computeDomain; }); function computeDomain(entityId) { return entityId.substr(0, entityId.indexOf(".")); } /***/ }), /***/ "../home-assistant-polymer/src/common/entity/compute_state_domain.ts": /*!***************************************************************************!*\ !*** ../home-assistant-polymer/src/common/entity/compute_state_domain.ts ***! \***************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return computeStateDomain; }); /* harmony import */ var _compute_domain__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./compute_domain */ "../home-assistant-polymer/src/common/entity/compute_domain.ts"); function computeStateDomain(stateObj) { return Object(_compute_domain__WEBPACK_IMPORTED_MODULE_0__["default"])(stateObj.entity_id); } /***/ }), /***/ "../home-assistant-polymer/src/common/entity/get_group_entities.ts": /*!*************************************************************************!*\ !*** ../home-assistant-polymer/src/common/entity/get_group_entities.ts ***! \*************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getGroupEntities; }); function getGroupEntities(entities, group) { const result = {}; group.attributes.entity_id.forEach(entityId => { const entity = entities[entityId]; if (entity) { result[entity.entity_id] = entity; } }); return result; } /***/ }), /***/ "../home-assistant-polymer/src/common/entity/get_view_entities.ts": /*!************************************************************************!*\ !*** ../home-assistant-polymer/src/common/entity/get_view_entities.ts ***! \************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return getViewEntities; }); /* harmony import */ var _compute_domain__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./compute_domain */ "../home-assistant-polymer/src/common/entity/compute_domain.ts"); /* harmony import */ var _get_group_entities__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./get_group_entities */ "../home-assistant-polymer/src/common/entity/get_group_entities.ts"); // Return an object containing all entities that the view will show // including embedded groups. function getViewEntities(entities, view) { const viewEntities = {}; view.attributes.entity_id.forEach(entityId => { const entity = entities[entityId]; if (entity && !entity.attributes.hidden) { viewEntities[entity.entity_id] = entity; if (Object(_compute_domain__WEBPACK_IMPORTED_MODULE_0__["default"])(entity.entity_id) === "group") { const groupEntities = Object(_get_group_entities__WEBPACK_IMPORTED_MODULE_1__["default"])(entities, entity); Object.keys(groupEntities).forEach(grEntityId => { const grEntity = groupEntities[grEntityId]; if (!grEntity.attributes.hidden) { viewEntities[grEntityId] = grEntity; } }); } } }); return viewEntities; } /***/ }), /***/ "../home-assistant-polymer/src/common/entity/state_card_type.ts": /*!**********************************************************************!*\ !*** ../home-assistant-polymer/src/common/entity/state_card_type.ts ***! \**********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "default", function() { return stateCardType; }); /* harmony import */ var _can_toggle_state__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./can_toggle_state */ "../home-assistant-polymer/src/common/entity/can_toggle_state.ts"); /* harmony import */ var _compute_state_domain__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./compute_state_domain */ "../home-assistant-polymer/src/common/entity/compute_state_domain.ts"); /* harmony import */ var _const__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../const */ "../home-assistant-polymer/src/common/const.ts"); function stateCardType(hass, stateObj) { if (stateObj.state === "unavailable") { return "display"; } const domain = Object(_compute_state_domain__WEBPACK_IMPORTED_MODULE_1__["default"])(stateObj); if (_const__WEBPACK_IMPORTED_MODULE_2__["DOMAINS_WITH_CARD"].includes(domain)) { return domain; } if (Object(_can_toggle_state__WEBPACK_IMPORTED_MODULE_0__["default"])(hass, stateObj) && stateObj.attributes.control !== "hidden") { return "toggle"; } return "display"; } /***/ }), /***/ "../home-assistant-polymer/src/common/entity/supports-feature.ts": /*!***********************************************************************!*\ !*** ../home-assistant-polymer/src/common/entity/supports-feature.ts ***! \***********************************************************************/ /*! exports provided: supportsFeature */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "supportsFeature", function() { return supportsFeature; }); const supportsFeature = (stateObj, feature) => { // tslint:disable-next-line:no-bitwise return (stateObj.attributes.supported_features & feature) !== 0; }; /***/ }), /***/ "../home-assistant-polymer/src/util/hass-attributes-util.js": /*!******************************************************************!*\ !*** ../home-assistant-polymer/src/util/hass-attributes-util.js ***! \******************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); const hassAttributeUtil = {}; hassAttributeUtil.DOMAIN_DEVICE_CLASS = { binary_sensor: ["battery", "cold", "connectivity", "door", "garage_door", "gas", "heat", "light", "lock", "moisture", "motion", "moving", "occupancy", "opening", "plug", "power", "presence", "problem", "safety", "smoke", "sound", "vibration", "window"], cover: ["awning", "blind", "curtain", "damper", "door", "garage", "shade", "shutter", "window"], sensor: ["battery", "humidity", "illuminance", "temperature", "pressure", "power", "signal_strength"], switch: ["switch", "outlet"] }; hassAttributeUtil.UNKNOWN_TYPE = "json"; hassAttributeUtil.ADD_TYPE = "key-value"; hassAttributeUtil.TYPE_TO_TAG = { string: "ha-customize-string", json: "ha-customize-string", icon: "ha-customize-icon", boolean: "ha-customize-boolean", array: "ha-customize-array", "key-value": "ha-customize-key-value" }; // Attributes here serve dual purpose: // 1) Any key of this object won't be shown in more-info window. // 2) Any key which has value other than undefined will appear in customization // config according to its value. hassAttributeUtil.LOGIC_STATE_ATTRIBUTES = hassAttributeUtil.LOGIC_STATE_ATTRIBUTES || { entity_picture: undefined, friendly_name: { type: "string", description: "Name" }, icon: { type: "icon" }, emulated_hue: { type: "boolean", domains: ["emulated_hue"] }, emulated_hue_name: { type: "string", domains: ["emulated_hue"] }, haaska_hidden: undefined, haaska_name: undefined, homebridge_hidden: { type: "boolean" }, homebridge_name: { type: "string" }, supported_features: undefined, attribution: undefined, custom_ui_more_info: { type: "string" }, custom_ui_state_card: { type: "string" }, device_class: { type: "array", options: hassAttributeUtil.DOMAIN_DEVICE_CLASS, description: "Device class", domains: ["binary_sensor", "cover", "sensor", "switch"] }, hidden: { type: "boolean", description: "Hide from UI" }, assumed_state: { type: "boolean", domains: ["switch", "light", "cover", "climate", "fan", "group", "water_heater"] }, initial_state: { type: "string", domains: ["automation"] }, unit_of_measurement: { type: "string" } }; /* harmony default export */ __webpack_exports__["default"] = (hassAttributeUtil); /***/ }), /***/ "./node_modules/@polymer/polymer/lib/utils/boot.js": /*!*********************************************************!*\ !*** ./node_modules/@polymer/polymer/lib/utils/boot.js ***! \*********************************************************/ /*! no static exports found */ /***/ (function(module, exports) { /** @license Copyright (c) 2017 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ window.JSCompiler_renameProperty = function (prop) { return prop; }; /***/ }), /***/ "./node_modules/@polymer/polymer/lib/utils/html-tag.js": /*!*************************************************************!*\ !*** ./node_modules/@polymer/polymer/lib/utils/html-tag.js ***! \*************************************************************/ /*! exports provided: html, htmlLiteral */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; __webpack_require__.r(__webpack_exports__); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "html", function() { return html; }); /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "htmlLiteral", function() { return htmlLiteral; }); /* harmony import */ var _boot_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./boot.js */ "./node_modules/@polymer/polymer/lib/utils/boot.js"); /* harmony import */ var _boot_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_boot_js__WEBPACK_IMPORTED_MODULE_0__); /** @license Copyright (c) 2017 The Polymer Project Authors. All rights reserved. This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt Code distributed by Google as part of the polymer project is also subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt */ /** * Class representing a static string value which can be used to filter * strings by asseting that they have been created via this class. The * `value` property returns the string passed to the constructor. */ class LiteralString { constructor(string) { /** @type {string} */ this.value = string.toString(); } /** * @return {string} LiteralString string value */ toString() { return this.value; } } /** * @param {*} value Object to stringify into HTML * @return {string} HTML stringified form of `obj` */ function literalValue(value) { if (value instanceof LiteralString) { return ( /** @type {!LiteralString} */ value.value ); } else { throw new Error(`non-literal value passed to Polymer's htmlLiteral function: ${value}`); } } /** * @param {*} value Object to stringify into HTML * @return {string} HTML stringified form of `obj` */ function htmlValue(value) { if (value instanceof HTMLTemplateElement) { return ( /** @type {!HTMLTemplateElement } */ value.innerHTML ); } else if (value instanceof LiteralString) { return literalValue(value); } else { throw new Error(`non-template value passed to Polymer's html function: ${value}`); } } /** * A template literal tag that creates an HTML