diff --git a/.eslintrc-hound.json b/.eslintrc-hound.json index f381b50114..cfb0b38da6 100644 --- a/.eslintrc-hound.json +++ b/.eslintrc-hound.json @@ -1,5 +1,5 @@ { - "extends": "airbnb-base", + "extends": ["airbnb-base", "prettier"], "parserOptions": { "ecmaFeatures": { "jsx": true, @@ -67,13 +67,11 @@ "react/no-find-dom-node": 2, "react/no-is-mounted": 2, "react/jsx-no-comment-textnodes": 2, - "react/jsx-curly-spacing": 2, "react/jsx-no-undef": 2, "react/jsx-uses-react": 2, "react/jsx-uses-vars": 2, - "no-restricted-syntax": [0, "ForOfStatement"] + "no-restricted-syntax": [0, "ForOfStatement"], + "prettier/prettier": "error" }, - "plugins": [ - "react" - ] + "plugins": ["react", "prettier"] } diff --git a/gallery/src/components/demo-card.js b/gallery/src/components/demo-card.js index 83b0c51f4d..7afb2ce94f 100644 --- a/gallery/src/components/demo-card.js +++ b/gallery/src/components/demo-card.js @@ -1,12 +1,12 @@ -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; -import JsYaml from 'js-yaml'; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; +import JsYaml from "js-yaml"; -import HomeAssistant from '../data/hass.js'; -import demoConfig from '../data/demo_config.js'; -import demoResources from '../data/demo_resources.js'; -import demoStates from '../data/demo_states.js'; -import createCardElement from '../../../src/panels/lovelace/common/create-card-element.js'; +import HomeAssistant from "../data/hass.js"; +import demoConfig from "../data/demo_config.js"; +import demoResources from "../data/demo_resources.js"; +import demoStates from "../data/demo_states.js"; +import createCardElement from "../../../src/panels/lovelace/common/create-card-element.js"; class DemoCard extends PolymerElement { static get template() { @@ -50,11 +50,11 @@ class DemoCard extends PolymerElement { return { hass: { type: Object, - observer: '_hassChanged', + observer: "_hassChanged", }, config: { type: Object, - observer: '_configChanged' + observer: "_configChanged", }, showConfig: Boolean, }; @@ -74,7 +74,7 @@ class DemoCard extends PolymerElement { const hass = new HomeAssistant(demoStates); hass.config = demoConfig; hass.resources = demoResources; - hass.language = 'en'; + hass.language = "en"; hass.states = demoStates; el.hass = hass; } @@ -92,4 +92,4 @@ class DemoCard extends PolymerElement { } } -customElements.define('demo-card', DemoCard); +customElements.define("demo-card", DemoCard); diff --git a/gallery/src/components/demo-cards.js b/gallery/src/components/demo-cards.js index 498c860a45..45920ef5a5 100644 --- a/gallery/src/components/demo-cards.js +++ b/gallery/src/components/demo-cards.js @@ -1,9 +1,9 @@ -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; -import '@polymer/app-layout/app-toolbar/app-toolbar.js'; -import '@polymer/paper-toggle-button/paper-toggle-button.js'; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; +import "@polymer/app-layout/app-toolbar/app-toolbar.js"; +import "@polymer/paper-toggle-button/paper-toggle-button.js"; -import './demo-card.js'; +import "./demo-card.js"; class DemoCards extends PolymerElement { static get template() { @@ -50,9 +50,9 @@ class DemoCards extends PolymerElement { _showConfig: { type: Boolean, value: false, - } + }, }; } } -customElements.define('demo-cards', DemoCards); +customElements.define("demo-cards", DemoCards); diff --git a/gallery/src/components/demo-more-info.js b/gallery/src/components/demo-more-info.js index 8273366f3b..8438733d6e 100644 --- a/gallery/src/components/demo-more-info.js +++ b/gallery/src/components/demo-more-info.js @@ -1,10 +1,9 @@ -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; - -import '../../../src/state-summary/state-card-content.js'; -import '../../../src/dialogs/more-info/controls/more-info-content.js'; -import '../../../src/components/ha-card.js'; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; +import "../../../src/state-summary/state-card-content.js"; +import "../../../src/dialogs/more-info/controls/more-info-content.js"; +import "../../../src/components/ha-card.js"; class DemoMoreInfo extends PolymerElement { static get template() { @@ -68,8 +67,8 @@ class DemoMoreInfo extends PolymerElement { showConfig: Boolean, _stateObj: { type: Object, - computed: '_getState(entityId, hass.states)' - } + computed: "_getState(entityId, hass.states)", + }, }; } @@ -82,7 +81,7 @@ class DemoMoreInfo extends PolymerElement { // (it sucks, we will remove in the future) const tmp = {}; Object.keys(stateObj).forEach((key) => { - if (key[0] !== '_') { + if (key[0] !== "_") { tmp[key] = stateObj[key]; } }); @@ -90,4 +89,4 @@ class DemoMoreInfo extends PolymerElement { } } -customElements.define('demo-more-info', DemoMoreInfo); +customElements.define("demo-more-info", DemoMoreInfo); diff --git a/gallery/src/components/demo-more-infos.js b/gallery/src/components/demo-more-infos.js index b59c01c40f..c44b114e95 100644 --- a/gallery/src/components/demo-more-infos.js +++ b/gallery/src/components/demo-more-infos.js @@ -1,9 +1,9 @@ -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; -import '@polymer/app-layout/app-toolbar/app-toolbar.js'; -import '@polymer/paper-toggle-button/paper-toggle-button.js'; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; +import "@polymer/app-layout/app-toolbar/app-toolbar.js"; +import "@polymer/paper-toggle-button/paper-toggle-button.js"; -import './demo-more-info.js'; +import "./demo-more-info.js"; class DemoMoreInfos extends PolymerElement { static get template() { @@ -50,9 +50,9 @@ class DemoMoreInfos extends PolymerElement { _showConfig: { type: Boolean, value: false, - } + }, }; } } -customElements.define('demo-more-infos', DemoMoreInfos); +customElements.define("demo-more-infos", DemoMoreInfos); diff --git a/gallery/src/data/demo_config.js b/gallery/src/data/demo_config.js index 7481664aac..43c5916ada 100644 --- a/gallery/src/data/demo_config.js +++ b/gallery/src/data/demo_config.js @@ -4,172 +4,106 @@ export default { latitude: 51.5287352, longitude: -0.381773, unit_system: { - length: 'km', - mass: 'kg', - temperature: '°C', - volume: 'L' - } + length: "km", + mass: "kg", + temperature: "°C", + volume: "L", + }, }, services: { - configurator: [ - 'configure' - ], - tts: [ - 'demo_say', - 'clear_cache' - ], + configurator: ["configure"], + tts: ["demo_say", "clear_cache"], cover: [ - 'open_cover', - 'close_cover', - 'open_cover_tilt', - 'close_cover_tilt', - 'set_cover_tilt_position', - 'set_cover_position', - 'stop_cover_tilt', - 'stop_cover' - ], - group: [ - 'set', - 'reload', - 'remove', - 'set_visibility' + "open_cover", + "close_cover", + "open_cover_tilt", + "close_cover_tilt", + "set_cover_tilt_position", + "set_cover_position", + "stop_cover_tilt", + "stop_cover", ], + group: ["set", "reload", "remove", "set_visibility"], alarm_control_panel: [ - 'alarm_arm_night', - 'alarm_disarm', - 'alarm_trigger', - 'alarm_arm_home', - 'alarm_arm_away', - 'alarm_arm_custom_bypass' - ], - conversation: [ - 'process' - ], - notify: [ - 'demo_test_target_name', - 'notify' - ], - lock: [ - 'open', - 'lock', - 'unlock' + "alarm_arm_night", + "alarm_disarm", + "alarm_trigger", + "alarm_arm_home", + "alarm_arm_away", + "alarm_arm_custom_bypass", ], + conversation: ["process"], + notify: ["demo_test_target_name", "notify"], + lock: ["open", "lock", "unlock"], input_select: [ - 'select_previous', - 'set_options', - 'select_next', - 'select_option' - ], - recorder: [ - 'purge' - ], - persistent_notification: [ - 'create', - 'dismiss' - ], - timer: [ - 'pause', - 'cancel', - 'finish', - 'start' - ], - input_boolean: [ - 'turn_off', - 'toggle', - 'turn_on' + "select_previous", + "set_options", + "select_next", + "select_option", ], + recorder: ["purge"], + persistent_notification: ["create", "dismiss"], + timer: ["pause", "cancel", "finish", "start"], + input_boolean: ["turn_off", "toggle", "turn_on"], fan: [ - 'set_speed', - 'turn_on', - 'turn_off', - 'set_direction', - 'oscillate', - 'toggle' + "set_speed", + "turn_on", + "turn_off", + "set_direction", + "oscillate", + "toggle", ], climate: [ - 'set_humidity', - 'set_operation_mode', - 'set_aux_heat', - 'turn_on', - 'set_hold_mode', - 'set_away_mode', - 'turn_off', - 'set_fan_mode', - 'set_temperature', - 'set_swing_mode' - ], - switch: [ - 'turn_off', - 'toggle', - 'turn_on' - ], - script: [ - 'turn_off', - 'demo', - 'reload', - 'toggle', - 'turn_on' - ], - scene: [ - 'turn_on' - ], - system_log: [ - 'clear', - 'write' - ], - camera: [ - 'disable_motion_detection', - 'enable_motion_detection', - 'snapshot' - ], - image_processing: [ - 'scan' + "set_humidity", + "set_operation_mode", + "set_aux_heat", + "turn_on", + "set_hold_mode", + "set_away_mode", + "turn_off", + "set_fan_mode", + "set_temperature", + "set_swing_mode", ], + switch: ["turn_off", "toggle", "turn_on"], + script: ["turn_off", "demo", "reload", "toggle", "turn_on"], + scene: ["turn_on"], + system_log: ["clear", "write"], + camera: ["disable_motion_detection", "enable_motion_detection", "snapshot"], + image_processing: ["scan"], media_player: [ - 'media_previous_track', - 'clear_playlist', - 'shuffle_set', - 'media_seek', - 'turn_on', - 'media_play_pause', - 'media_next_track', - 'media_pause', - 'volume_down', - 'volume_set', - 'media_stop', - 'toggle', - 'media_play', - 'play_media', - 'volume_mute', - 'turn_off', - 'select_sound_mode', - 'select_source', - 'volume_up' - ], - input_number: [ - 'set_value', - 'increment', - 'decrement' - ], - device_tracker: [ - 'see' + "media_previous_track", + "clear_playlist", + "shuffle_set", + "media_seek", + "turn_on", + "media_play_pause", + "media_next_track", + "media_pause", + "volume_down", + "volume_set", + "media_stop", + "toggle", + "media_play", + "play_media", + "volume_mute", + "turn_off", + "select_sound_mode", + "select_source", + "volume_up", ], + input_number: ["set_value", "increment", "decrement"], + device_tracker: ["see"], homeassistant: [ - 'stop', - 'check_config', - 'reload_core_config', - 'turn_on', - 'turn_off', - 'restart', - 'toggle' + "stop", + "check_config", + "reload_core_config", + "turn_on", + "turn_off", + "restart", + "toggle", ], - light: [ - 'turn_off', - 'toggle', - 'turn_on' - ], - input_text: [ - 'set_value' - ] - } + light: ["turn_off", "toggle", "turn_on"], + input_text: ["set_value"], + }, }; diff --git a/gallery/src/data/demo_resources.js b/gallery/src/data/demo_resources.js index f1edb6fd4b..b998863dff 100644 --- a/gallery/src/data/demo_resources.js +++ b/gallery/src/data/demo_resources.js @@ -1,253 +1,264 @@ export default { en: { - 'state.default.off': 'Off', - 'state.default.on': 'On', - 'state.default.unknown': 'Unknown', - 'state.default.unavailable': 'Unavailable', - 'state.alarm_control_panel.armed': 'Armed', - 'state.alarm_control_panel.disarmed': 'Disarmed', - 'state.alarm_control_panel.armed_home': 'Armed home', - 'state.alarm_control_panel.armed_away': 'Armed away', - 'state.alarm_control_panel.armed_night': 'Armed night', - 'state.alarm_control_panel.armed_custom_bypass': 'Armed custom bypass', - 'state.alarm_control_panel.pending': 'Pending', - 'state.alarm_control_panel.arming': 'Arming', - 'state.alarm_control_panel.disarming': 'Disarming', - 'state.alarm_control_panel.triggered': 'Triggered', - 'state.automation.off': 'Off', - 'state.automation.on': 'On', - 'state.binary_sensor.default.off': 'Off', - 'state.binary_sensor.default.on': 'On', - 'state.binary_sensor.battery.off': 'Normal', - 'state.binary_sensor.battery.on': 'Low', - 'state.binary_sensor.cold.off': 'Normal', - 'state.binary_sensor.cold.on': 'Cold', - 'state.binary_sensor.connectivity.off': 'Disconnected', - 'state.binary_sensor.connectivity.on': 'Connected', - 'state.binary_sensor.door.off': 'Closed', - 'state.binary_sensor.door.on': 'Open', - 'state.binary_sensor.garage_door.off': 'Closed', - 'state.binary_sensor.garage_door.on': 'Open', - 'state.binary_sensor.gas.off': 'Clear', - 'state.binary_sensor.gas.on': 'Detected', - 'state.binary_sensor.heat.off': 'Normal', - 'state.binary_sensor.heat.on': 'Hot', - 'state.binary_sensor.lock.off': 'Locked', - 'state.binary_sensor.lock.on': 'Unlocked', - 'state.binary_sensor.moisture.off': 'Dry', - 'state.binary_sensor.moisture.on': 'Wet', - 'state.binary_sensor.motion.off': 'Clear', - 'state.binary_sensor.motion.on': 'Detected', - 'state.binary_sensor.occupancy.off': 'Clear', - 'state.binary_sensor.occupancy.on': 'Detected', - 'state.binary_sensor.opening.off': 'Closed', - 'state.binary_sensor.opening.on': 'Open', - 'state.binary_sensor.presence.off': 'Away', - 'state.binary_sensor.presence.on': 'Home', - 'state.binary_sensor.problem.off': 'OK', - 'state.binary_sensor.problem.on': 'Problem', - 'state.binary_sensor.safety.off': 'Safe', - 'state.binary_sensor.safety.on': 'Unsafe', - 'state.binary_sensor.smoke.off': 'Clear', - 'state.binary_sensor.smoke.on': 'Detected', - 'state.binary_sensor.sound.off': 'Clear', - 'state.binary_sensor.sound.on': 'Detected', - 'state.binary_sensor.vibration.off': 'Clear', - 'state.binary_sensor.vibration.on': 'Detected', - 'state.binary_sensor.window.off': 'Closed', - 'state.binary_sensor.window.on': 'Open', - 'state.calendar.off': 'Off', - 'state.calendar.on': 'On', - 'state.camera.recording': 'Recording', - 'state.camera.streaming': 'Streaming', - 'state.camera.idle': 'Idle', - 'state.climate.off': 'Off', - 'state.climate.on': 'On', - 'state.climate.heat': 'Heat', - 'state.climate.cool': 'Cool', - 'state.climate.idle': 'Idle', - 'state.climate.auto': 'Auto', - 'state.climate.dry': 'Dry', - 'state.climate.fan_only': 'Fan only', - 'state.climate.eco': 'Eco', - 'state.climate.electric': 'Electric', - 'state.climate.performance': 'Performance', - 'state.climate.high_demand': 'High demand', - 'state.climate.heat_pump': 'Heat pump', - 'state.climate.gas': 'Gas', - 'state.configurator.configure': 'Configure', - 'state.configurator.configured': 'Configured', - 'state.cover.open': 'Open', - 'state.cover.opening': 'Opening', - 'state.cover.closed': 'Closed', - 'state.cover.closing': 'Closing', - 'state.cover.stopped': 'Stopped', - 'state.device_tracker.home': 'Home', - 'state.device_tracker.not_home': 'Away', - 'state.fan.off': 'Off', - 'state.fan.on': 'On', - 'state.group.off': 'Off', - 'state.group.on': 'On', - 'state.group.home': 'Home', - 'state.group.not_home': 'Away', - 'state.group.open': 'Open', - 'state.group.opening': 'Opening', - 'state.group.closed': 'Closed', - 'state.group.closing': 'Closing', - 'state.group.stopped': 'Stopped', - 'state.group.locked': 'Locked', - 'state.group.unlocked': 'Unlocked', - 'state.group.ok': 'OK', - 'state.group.problem': 'Problem', - 'state.input_boolean.off': 'Off', - 'state.input_boolean.on': 'On', - 'state.light.off': 'Off', - 'state.light.on': 'On', - 'state.lock.locked': 'Locked', - 'state.lock.unlocked': 'Unlocked', - 'state.media_player.off': 'Off', - 'state.media_player.on': 'On', - 'state.media_player.playing': 'Playing', - 'state.media_player.paused': 'Paused', - 'state.media_player.idle': 'Idle', - 'state.media_player.standby': 'Standby', - 'state.plant.ok': 'OK', - 'state.plant.problem': 'Problem', - 'state.remote.off': 'Off', - 'state.remote.on': 'On', - 'state.scene.scening': 'Scening', - 'state.script.off': 'Off', - 'state.script.on': 'On', - 'state.sensor.off': 'Off', - 'state.sensor.on': 'On', - 'state.sun.above_horizon': 'Above horizon', - 'state.sun.below_horizon': 'Below horizon', - 'state.switch.off': 'Off', - 'state.switch.on': 'On', - 'state.weather.clear-night': 'Clear, night', - 'state.weather.cloudy': 'Cloudy', - 'state.weather.fog': 'Fog', - 'state.weather.hail': 'Hail', - 'state.weather.lightning': 'Lightning', - 'state.weather.lightning-rainy': 'Lightning, rainy', - 'state.weather.partlycloudy': 'Partly cloudy', - 'state.weather.pouring': 'Pouring', - 'state.weather.rainy': 'Rainy', - 'state.weather.snowy': 'Snowy', - 'state.weather.snowy-rainy': 'Snowy, rainy', - 'state.weather.sunny': 'Sunny', - 'state.weather.windy': 'Windy', - 'state.weather.windy-variant': 'Windy', - 'state.zwave.default.initializing': 'Initializing', - 'state.zwave.default.dead': 'Dead', - 'state.zwave.default.sleeping': 'Sleeping', - 'state.zwave.default.ready': 'Ready', - 'state.zwave.query_stage.initializing': 'Initializing ({query_stage})', - 'state.zwave.query_stage.dead': 'Dead ({query_stage})', - 'state_badge.default.unknown': 'Unk', - 'state_badge.default.unavailable': 'Unavai', - 'state_badge.alarm_control_panel.armed': 'Armed', - 'state_badge.alarm_control_panel.disarmed': 'Disarm', - 'state_badge.alarm_control_panel.armed_home': 'Armed', - 'state_badge.alarm_control_panel.armed_away': 'Armed', - 'state_badge.alarm_control_panel.armed_night': 'Armed', - 'state_badge.alarm_control_panel.armed_custom_bypass': 'Armed', - 'state_badge.alarm_control_panel.pending': 'Pend', - 'state_badge.alarm_control_panel.arming': 'Arming', - 'state_badge.alarm_control_panel.disarming': 'Disarm', - 'state_badge.alarm_control_panel.triggered': 'Trig', - 'state_badge.device_tracker.home': 'Home', - 'state_badge.device_tracker.not_home': 'Away', - 'ui.card.alarm_control_panel.code': 'Code', - 'ui.card.alarm_control_panel.clear_code': 'Clear', - 'ui.card.alarm_control_panel.disarm': 'Disarm', - 'ui.card.alarm_control_panel.arm_home': 'Arm home', - 'ui.card.alarm_control_panel.arm_away': 'Arm away', - 'ui.card.automation.last_triggered': 'Last triggered', - 'ui.card.automation.trigger': 'Trigger', - 'ui.card.camera.not_available': 'Image not available', - 'ui.card.climate.currently': 'Currently', - 'ui.card.climate.on_off': 'On / off', - 'ui.card.climate.target_temperature': 'Target temperature', - 'ui.card.climate.target_humidity': 'Target humidity', - 'ui.card.climate.operation': 'Operation', - 'ui.card.climate.fan_mode': 'Fan mode', - 'ui.card.climate.swing_mode': 'Swing mode', - 'ui.card.climate.away_mode': 'Away mode', - 'ui.card.climate.aux_heat': 'Aux heat', - 'ui.card.cover.position': 'Position', - 'ui.card.cover.tilt_position': 'Tilt position', - 'ui.card.fan.speed': 'Speed', - 'ui.card.fan.oscillate': 'Oscillate', - 'ui.card.fan.direction': 'Direction', - 'ui.card.light.brightness': 'Brightness', - 'ui.card.light.color_temperature': 'Color temperature', - 'ui.card.light.white_value': 'White value', - 'ui.card.light.effect': 'Effect', - 'ui.card.lock.code': 'Code', - 'ui.card.lock.lock': 'Lock', - 'ui.card.lock.unlock': 'Unlock', - 'ui.card.media_player.source': 'Source', - 'ui.card.media_player.sound_mode': 'Sound mode', - 'ui.card.media_player.text_to_speak': 'Text to speak', - 'ui.card.persistent_notification.dismiss': 'Dismiss', - 'ui.card.scene.activate': 'Activate', - 'ui.card.script.execute': 'Execute', - 'ui.card.weather.attributes.air_pressure': 'Air pressure', - 'ui.card.weather.attributes.humidity': 'Humidity', - 'ui.card.weather.attributes.temperature': 'Temperature', - 'ui.card.weather.attributes.visibility': 'Visibility', - 'ui.card.weather.attributes.wind_speed': 'Wind speed', - 'ui.card.weather.cardinal_direction.e': 'E', - 'ui.card.weather.cardinal_direction.ene': 'ENE', - 'ui.card.weather.cardinal_direction.ese': 'ESE', - 'ui.card.weather.cardinal_direction.n': 'N', - 'ui.card.weather.cardinal_direction.ne': 'NE', - 'ui.card.weather.cardinal_direction.nne': 'NNE', - 'ui.card.weather.cardinal_direction.nw': 'NW', - 'ui.card.weather.cardinal_direction.nnw': 'NNW', - 'ui.card.weather.cardinal_direction.s': 'S', - 'ui.card.weather.cardinal_direction.se': 'SE', - 'ui.card.weather.cardinal_direction.sse': 'SSE', - 'ui.card.weather.cardinal_direction.ssw': 'SSW', - 'ui.card.weather.cardinal_direction.sw': 'SW', - 'ui.card.weather.cardinal_direction.w': 'W', - 'ui.card.weather.cardinal_direction.wnw': 'WNW', - 'ui.card.weather.cardinal_direction.wsw': 'WSW', - 'ui.card.weather.forecast': 'Forecast', - 'ui.common.loading': 'Loading', - 'ui.common.cancel': 'Cancel', - 'ui.components.entity.entity-picker.entity': 'Entity', - 'ui.components.relative_time.past': '{time} ago', - 'ui.components.relative_time.future': 'In {time}', - 'ui.components.relative_time.never': 'Never', - 'ui.components.relative_time.duration.second': '{count} {count, plural,\n one {second}\n other {seconds}\n}', - 'ui.components.relative_time.duration.minute': '{count} {count, plural,\n one {minute}\n other {minutes}\n}', - 'ui.components.relative_time.duration.hour': '{count} {count, plural,\n one {hour}\n other {hours}\n}', - 'ui.components.relative_time.duration.day': '{count} {count, plural,\n one {day}\n other {days}\n}', - 'ui.components.relative_time.duration.week': '{count} {count, plural,\n one {week}\n other {weeks}\n}', - 'ui.components.history_charts.loading_history': 'Loading state history...', - 'ui.components.history_charts.no_history_found': 'No state history found.', - 'ui.components.service-picker.service': 'Service', - 'ui.dialogs.more_info_settings.save': 'Save', - 'ui.dialogs.more_info_settings.name': 'Name', - 'ui.duration.second': '{count} {count, plural,\n one {second}\n other {seconds}\n}', - 'ui.duration.minute': '{count} {count, plural,\n one {minute}\n other {minutes}\n}', - 'ui.duration.hour': '{count} {count, plural,\n one {hour}\n other {hours}\n}', - 'ui.duration.day': '{count} {count, plural,\n one {day}\n other {days}\n}', - 'ui.duration.week': '{count} {count, plural,\n one {week}\n other {weeks}\n}', - 'ui.login-form.password': 'Password', - 'ui.login-form.remember': 'Remember', - 'ui.login-form.log_in': 'Log in', - 'ui.notification_toast.entity_turned_on': 'Turned on {entity}.', - 'ui.notification_toast.entity_turned_off': 'Turned off {entity}.', - 'ui.notification_toast.service_called': 'Service {service} called.', - 'ui.notification_toast.service_call_failed': 'Failed to call service {service}.', - 'ui.notification_toast.connection_lost': 'Connection lost. Reconnecting…', - 'ui.sidebar.developer_tools': 'Developer tools', - 'ui.sidebar.log_out': 'Log out', - 'attribute.weather.humidity': 'Humidity', - 'attribute.weather.visibility': 'Visibility', - 'attribute.weather.wind_speed': 'Wind speed', - } + "state.default.off": "Off", + "state.default.on": "On", + "state.default.unknown": "Unknown", + "state.default.unavailable": "Unavailable", + "state.alarm_control_panel.armed": "Armed", + "state.alarm_control_panel.disarmed": "Disarmed", + "state.alarm_control_panel.armed_home": "Armed home", + "state.alarm_control_panel.armed_away": "Armed away", + "state.alarm_control_panel.armed_night": "Armed night", + "state.alarm_control_panel.armed_custom_bypass": "Armed custom bypass", + "state.alarm_control_panel.pending": "Pending", + "state.alarm_control_panel.arming": "Arming", + "state.alarm_control_panel.disarming": "Disarming", + "state.alarm_control_panel.triggered": "Triggered", + "state.automation.off": "Off", + "state.automation.on": "On", + "state.binary_sensor.default.off": "Off", + "state.binary_sensor.default.on": "On", + "state.binary_sensor.battery.off": "Normal", + "state.binary_sensor.battery.on": "Low", + "state.binary_sensor.cold.off": "Normal", + "state.binary_sensor.cold.on": "Cold", + "state.binary_sensor.connectivity.off": "Disconnected", + "state.binary_sensor.connectivity.on": "Connected", + "state.binary_sensor.door.off": "Closed", + "state.binary_sensor.door.on": "Open", + "state.binary_sensor.garage_door.off": "Closed", + "state.binary_sensor.garage_door.on": "Open", + "state.binary_sensor.gas.off": "Clear", + "state.binary_sensor.gas.on": "Detected", + "state.binary_sensor.heat.off": "Normal", + "state.binary_sensor.heat.on": "Hot", + "state.binary_sensor.lock.off": "Locked", + "state.binary_sensor.lock.on": "Unlocked", + "state.binary_sensor.moisture.off": "Dry", + "state.binary_sensor.moisture.on": "Wet", + "state.binary_sensor.motion.off": "Clear", + "state.binary_sensor.motion.on": "Detected", + "state.binary_sensor.occupancy.off": "Clear", + "state.binary_sensor.occupancy.on": "Detected", + "state.binary_sensor.opening.off": "Closed", + "state.binary_sensor.opening.on": "Open", + "state.binary_sensor.presence.off": "Away", + "state.binary_sensor.presence.on": "Home", + "state.binary_sensor.problem.off": "OK", + "state.binary_sensor.problem.on": "Problem", + "state.binary_sensor.safety.off": "Safe", + "state.binary_sensor.safety.on": "Unsafe", + "state.binary_sensor.smoke.off": "Clear", + "state.binary_sensor.smoke.on": "Detected", + "state.binary_sensor.sound.off": "Clear", + "state.binary_sensor.sound.on": "Detected", + "state.binary_sensor.vibration.off": "Clear", + "state.binary_sensor.vibration.on": "Detected", + "state.binary_sensor.window.off": "Closed", + "state.binary_sensor.window.on": "Open", + "state.calendar.off": "Off", + "state.calendar.on": "On", + "state.camera.recording": "Recording", + "state.camera.streaming": "Streaming", + "state.camera.idle": "Idle", + "state.climate.off": "Off", + "state.climate.on": "On", + "state.climate.heat": "Heat", + "state.climate.cool": "Cool", + "state.climate.idle": "Idle", + "state.climate.auto": "Auto", + "state.climate.dry": "Dry", + "state.climate.fan_only": "Fan only", + "state.climate.eco": "Eco", + "state.climate.electric": "Electric", + "state.climate.performance": "Performance", + "state.climate.high_demand": "High demand", + "state.climate.heat_pump": "Heat pump", + "state.climate.gas": "Gas", + "state.configurator.configure": "Configure", + "state.configurator.configured": "Configured", + "state.cover.open": "Open", + "state.cover.opening": "Opening", + "state.cover.closed": "Closed", + "state.cover.closing": "Closing", + "state.cover.stopped": "Stopped", + "state.device_tracker.home": "Home", + "state.device_tracker.not_home": "Away", + "state.fan.off": "Off", + "state.fan.on": "On", + "state.group.off": "Off", + "state.group.on": "On", + "state.group.home": "Home", + "state.group.not_home": "Away", + "state.group.open": "Open", + "state.group.opening": "Opening", + "state.group.closed": "Closed", + "state.group.closing": "Closing", + "state.group.stopped": "Stopped", + "state.group.locked": "Locked", + "state.group.unlocked": "Unlocked", + "state.group.ok": "OK", + "state.group.problem": "Problem", + "state.input_boolean.off": "Off", + "state.input_boolean.on": "On", + "state.light.off": "Off", + "state.light.on": "On", + "state.lock.locked": "Locked", + "state.lock.unlocked": "Unlocked", + "state.media_player.off": "Off", + "state.media_player.on": "On", + "state.media_player.playing": "Playing", + "state.media_player.paused": "Paused", + "state.media_player.idle": "Idle", + "state.media_player.standby": "Standby", + "state.plant.ok": "OK", + "state.plant.problem": "Problem", + "state.remote.off": "Off", + "state.remote.on": "On", + "state.scene.scening": "Scening", + "state.script.off": "Off", + "state.script.on": "On", + "state.sensor.off": "Off", + "state.sensor.on": "On", + "state.sun.above_horizon": "Above horizon", + "state.sun.below_horizon": "Below horizon", + "state.switch.off": "Off", + "state.switch.on": "On", + "state.weather.clear-night": "Clear, night", + "state.weather.cloudy": "Cloudy", + "state.weather.fog": "Fog", + "state.weather.hail": "Hail", + "state.weather.lightning": "Lightning", + "state.weather.lightning-rainy": "Lightning, rainy", + "state.weather.partlycloudy": "Partly cloudy", + "state.weather.pouring": "Pouring", + "state.weather.rainy": "Rainy", + "state.weather.snowy": "Snowy", + "state.weather.snowy-rainy": "Snowy, rainy", + "state.weather.sunny": "Sunny", + "state.weather.windy": "Windy", + "state.weather.windy-variant": "Windy", + "state.zwave.default.initializing": "Initializing", + "state.zwave.default.dead": "Dead", + "state.zwave.default.sleeping": "Sleeping", + "state.zwave.default.ready": "Ready", + "state.zwave.query_stage.initializing": "Initializing ({query_stage})", + "state.zwave.query_stage.dead": "Dead ({query_stage})", + "state_badge.default.unknown": "Unk", + "state_badge.default.unavailable": "Unavai", + "state_badge.alarm_control_panel.armed": "Armed", + "state_badge.alarm_control_panel.disarmed": "Disarm", + "state_badge.alarm_control_panel.armed_home": "Armed", + "state_badge.alarm_control_panel.armed_away": "Armed", + "state_badge.alarm_control_panel.armed_night": "Armed", + "state_badge.alarm_control_panel.armed_custom_bypass": "Armed", + "state_badge.alarm_control_panel.pending": "Pend", + "state_badge.alarm_control_panel.arming": "Arming", + "state_badge.alarm_control_panel.disarming": "Disarm", + "state_badge.alarm_control_panel.triggered": "Trig", + "state_badge.device_tracker.home": "Home", + "state_badge.device_tracker.not_home": "Away", + "ui.card.alarm_control_panel.code": "Code", + "ui.card.alarm_control_panel.clear_code": "Clear", + "ui.card.alarm_control_panel.disarm": "Disarm", + "ui.card.alarm_control_panel.arm_home": "Arm home", + "ui.card.alarm_control_panel.arm_away": "Arm away", + "ui.card.automation.last_triggered": "Last triggered", + "ui.card.automation.trigger": "Trigger", + "ui.card.camera.not_available": "Image not available", + "ui.card.climate.currently": "Currently", + "ui.card.climate.on_off": "On / off", + "ui.card.climate.target_temperature": "Target temperature", + "ui.card.climate.target_humidity": "Target humidity", + "ui.card.climate.operation": "Operation", + "ui.card.climate.fan_mode": "Fan mode", + "ui.card.climate.swing_mode": "Swing mode", + "ui.card.climate.away_mode": "Away mode", + "ui.card.climate.aux_heat": "Aux heat", + "ui.card.cover.position": "Position", + "ui.card.cover.tilt_position": "Tilt position", + "ui.card.fan.speed": "Speed", + "ui.card.fan.oscillate": "Oscillate", + "ui.card.fan.direction": "Direction", + "ui.card.light.brightness": "Brightness", + "ui.card.light.color_temperature": "Color temperature", + "ui.card.light.white_value": "White value", + "ui.card.light.effect": "Effect", + "ui.card.lock.code": "Code", + "ui.card.lock.lock": "Lock", + "ui.card.lock.unlock": "Unlock", + "ui.card.media_player.source": "Source", + "ui.card.media_player.sound_mode": "Sound mode", + "ui.card.media_player.text_to_speak": "Text to speak", + "ui.card.persistent_notification.dismiss": "Dismiss", + "ui.card.scene.activate": "Activate", + "ui.card.script.execute": "Execute", + "ui.card.weather.attributes.air_pressure": "Air pressure", + "ui.card.weather.attributes.humidity": "Humidity", + "ui.card.weather.attributes.temperature": "Temperature", + "ui.card.weather.attributes.visibility": "Visibility", + "ui.card.weather.attributes.wind_speed": "Wind speed", + "ui.card.weather.cardinal_direction.e": "E", + "ui.card.weather.cardinal_direction.ene": "ENE", + "ui.card.weather.cardinal_direction.ese": "ESE", + "ui.card.weather.cardinal_direction.n": "N", + "ui.card.weather.cardinal_direction.ne": "NE", + "ui.card.weather.cardinal_direction.nne": "NNE", + "ui.card.weather.cardinal_direction.nw": "NW", + "ui.card.weather.cardinal_direction.nnw": "NNW", + "ui.card.weather.cardinal_direction.s": "S", + "ui.card.weather.cardinal_direction.se": "SE", + "ui.card.weather.cardinal_direction.sse": "SSE", + "ui.card.weather.cardinal_direction.ssw": "SSW", + "ui.card.weather.cardinal_direction.sw": "SW", + "ui.card.weather.cardinal_direction.w": "W", + "ui.card.weather.cardinal_direction.wnw": "WNW", + "ui.card.weather.cardinal_direction.wsw": "WSW", + "ui.card.weather.forecast": "Forecast", + "ui.common.loading": "Loading", + "ui.common.cancel": "Cancel", + "ui.components.entity.entity-picker.entity": "Entity", + "ui.components.relative_time.past": "{time} ago", + "ui.components.relative_time.future": "In {time}", + "ui.components.relative_time.never": "Never", + "ui.components.relative_time.duration.second": + "{count} {count, plural,\n one {second}\n other {seconds}\n}", + "ui.components.relative_time.duration.minute": + "{count} {count, plural,\n one {minute}\n other {minutes}\n}", + "ui.components.relative_time.duration.hour": + "{count} {count, plural,\n one {hour}\n other {hours}\n}", + "ui.components.relative_time.duration.day": + "{count} {count, plural,\n one {day}\n other {days}\n}", + "ui.components.relative_time.duration.week": + "{count} {count, plural,\n one {week}\n other {weeks}\n}", + "ui.components.history_charts.loading_history": "Loading state history...", + "ui.components.history_charts.no_history_found": "No state history found.", + "ui.components.service-picker.service": "Service", + "ui.dialogs.more_info_settings.save": "Save", + "ui.dialogs.more_info_settings.name": "Name", + "ui.duration.second": + "{count} {count, plural,\n one {second}\n other {seconds}\n}", + "ui.duration.minute": + "{count} {count, plural,\n one {minute}\n other {minutes}\n}", + "ui.duration.hour": + "{count} {count, plural,\n one {hour}\n other {hours}\n}", + "ui.duration.day": + "{count} {count, plural,\n one {day}\n other {days}\n}", + "ui.duration.week": + "{count} {count, plural,\n one {week}\n other {weeks}\n}", + "ui.login-form.password": "Password", + "ui.login-form.remember": "Remember", + "ui.login-form.log_in": "Log in", + "ui.notification_toast.entity_turned_on": "Turned on {entity}.", + "ui.notification_toast.entity_turned_off": "Turned off {entity}.", + "ui.notification_toast.service_called": "Service {service} called.", + "ui.notification_toast.service_call_failed": + "Failed to call service {service}.", + "ui.notification_toast.connection_lost": "Connection lost. Reconnecting…", + "ui.sidebar.developer_tools": "Developer tools", + "ui.sidebar.log_out": "Log out", + "attribute.weather.humidity": "Humidity", + "attribute.weather.visibility": "Visibility", + "attribute.weather.wind_speed": "Wind speed", + }, }; diff --git a/gallery/src/data/demo_states.js b/gallery/src/data/demo_states.js index 7bb446844e..dafbcfb866 100644 --- a/gallery/src/data/demo_states.js +++ b/gallery/src/data/demo_states.js @@ -1,293 +1,294 @@ export default { - 'sun.sun': { - entity_id: 'sun.sun', - state: 'below_horizon', + "sun.sun": { + entity_id: "sun.sun", + state: "below_horizon", attributes: { - next_dawn: '2018-07-19T20:48:47+00:00', - next_dusk: '2018-07-20T11:46:06+00:00', - next_midnight: '2018-07-19T16:17:28+00:00', - next_noon: '2018-07-20T04:17:26+00:00', - next_rising: '2018-07-19T21:16:31+00:00', - next_setting: '2018-07-20T11:18:22+00:00', + next_dawn: "2018-07-19T20:48:47+00:00", + next_dusk: "2018-07-20T11:46:06+00:00", + next_midnight: "2018-07-19T16:17:28+00:00", + next_noon: "2018-07-20T04:17:26+00:00", + next_rising: "2018-07-19T21:16:31+00:00", + next_setting: "2018-07-20T11:18:22+00:00", elevation: 67.69, azimuth: 338.55, - friendly_name: 'Sun' + friendly_name: "Sun", }, - last_changed: '2018-07-19T12:06:18.384550+00:00', - last_updated: '2018-07-19T12:40:30.374858+00:00', + last_changed: "2018-07-19T12:06:18.384550+00:00", + last_updated: "2018-07-19T12:40:30.374858+00:00", }, - 'zone.home': { - entity_id: 'zone.home', - state: 'zoning', + "zone.home": { + entity_id: "zone.home", + state: "zoning", attributes: { hidden: true, latitude: 0, longitude: 0, radius: 100, - friendly_name: 'Home', - icon: 'mdi:home' + friendly_name: "Home", + icon: "mdi:home", }, - last_changed: '2018-07-19T10:44:45.811040+00:00', - last_updated: '2018-07-19T10:44:45.811040+00:00' + last_changed: "2018-07-19T10:44:45.811040+00:00", + last_updated: "2018-07-19T10:44:45.811040+00:00", }, - 'persistent_notification.notification': { - entity_id: 'persistent_notification.notification', - state: 'notifying', + "persistent_notification.notification": { + entity_id: "persistent_notification.notification", + state: "notifying", attributes: { - title: 'Welcome Home!', - message: 'Here are some resources to get started:\n\n - [Configuring Home Assistant](https://home-assistant.io/getting-started/configuration/)\n - [Available components](https://home-assistant.io/components/)\n - [Troubleshooting your configuration](https://home-assistant.io/docs/configuration/troubleshooting/)\n - [Getting help](https://home-assistant.io/help/)\n\nTo not see this card popup in the future, edit your config in\n`configuration.yaml` and disable the `introduction` component.' + title: "Welcome Home!", + message: + "Here are some resources to get started:\n\n - [Configuring Home Assistant](https://home-assistant.io/getting-started/configuration/)\n - [Available components](https://home-assistant.io/components/)\n - [Troubleshooting your configuration](https://home-assistant.io/docs/configuration/troubleshooting/)\n - [Getting help](https://home-assistant.io/help/)\n\nTo not see this card popup in the future, edit your config in\n`configuration.yaml` and disable the `introduction` component.", }, - last_changed: '2018-07-19T10:44:45.922241+00:00', - last_updated: '2018-07-19T10:44:45.922241+00:00' + last_changed: "2018-07-19T10:44:45.922241+00:00", + last_updated: "2018-07-19T10:44:45.922241+00:00", }, - 'timer.laundry': { - entity_id: 'timer.laundry', - state: 'idle', + "timer.laundry": { + entity_id: "timer.laundry", + state: "idle", attributes: { - duration: '0:01:00', - remaining: '0:01:00' + duration: "0:01:00", + remaining: "0:01:00", }, - last_changed: '2018-07-19T10:44:45.923256+00:00', - last_updated: '2018-07-19T10:44:45.923256+00:00', + last_changed: "2018-07-19T10:44:45.923256+00:00", + last_updated: "2018-07-19T10:44:45.923256+00:00", }, - 'input_number.box1': { - entity_id: 'input_number.box1', - state: '30.0', + "input_number.box1": { + entity_id: "input_number.box1", + state: "30.0", attributes: { min: -20, max: 35, step: 1, - mode: 'box', - friendly_name: 'Numeric Input Box' + mode: "box", + friendly_name: "Numeric Input Box", }, - last_changed: '2018-07-19T10:44:45.923416+00:00', - last_updated: '2018-07-19T10:44:45.923416+00:00', + last_changed: "2018-07-19T10:44:45.923416+00:00", + last_updated: "2018-07-19T10:44:45.923416+00:00", }, - 'input_number.slider1': { - entity_id: 'input_number.slider1', - state: '30.0', + "input_number.slider1": { + entity_id: "input_number.slider1", + state: "30.0", attributes: { min: -20, max: 35, step: 1, - mode: 'slider', - unit_of_measurement: 'beers', - friendly_name: 'Slider' + mode: "slider", + unit_of_measurement: "beers", + friendly_name: "Slider", }, - last_changed: '2018-07-19T10:44:45.923572+00:00', - last_updated: '2018-07-19T10:44:45.923572+00:00', + last_changed: "2018-07-19T10:44:45.923572+00:00", + last_updated: "2018-07-19T10:44:45.923572+00:00", }, - 'sensor.brightness': { - entity_id: 'sensor.brightness', - state: '12', + "sensor.brightness": { + entity_id: "sensor.brightness", + state: "12", attributes: { maximum: 20, minimum: 0, - friendly_name: 'brightness', - icon: 'mdi:hanger' + friendly_name: "brightness", + icon: "mdi:hanger", }, - last_changed: '2018-07-19T12:40:28.378102+00:00', - last_updated: '2018-07-19T12:40:28.378102+00:00', + last_changed: "2018-07-19T12:40:28.378102+00:00", + last_updated: "2018-07-19T12:40:28.378102+00:00", }, - 'sensor.battery': { - entity_id: 'sensor.battery', - state: '2', + "sensor.battery": { + entity_id: "sensor.battery", + state: "2", attributes: { maximum: 20, minimum: 0, - friendly_name: 'battery', - icon: 'mdi:hanger' + friendly_name: "battery", + icon: "mdi:hanger", }, - last_changed: '2018-07-19T12:40:28.377758+00:00', - last_updated: '2018-07-19T12:40:28.377758+00:00', + last_changed: "2018-07-19T12:40:28.377758+00:00", + last_updated: "2018-07-19T12:40:28.377758+00:00", }, - 'sensor.outside_temperature': { - entity_id: 'sensor.outside_temperature', - state: '15.6', + "sensor.outside_temperature": { + entity_id: "sensor.outside_temperature", + state: "15.6", attributes: { battery_level: 12, - unit_of_measurement: '°C', - friendly_name: 'Outside Temperature', - device_class: 'temperature' + unit_of_measurement: "°C", + friendly_name: "Outside Temperature", + device_class: "temperature", }, - last_changed: '2018-07-19T10:44:45.924111+00:00', - last_updated: '2018-07-19T10:44:45.924111+00:00', + last_changed: "2018-07-19T10:44:45.924111+00:00", + last_updated: "2018-07-19T10:44:45.924111+00:00", }, - 'sensor.outside_humidity': { - entity_id: 'sensor.outside_humidity', - state: '54', + "sensor.outside_humidity": { + entity_id: "sensor.outside_humidity", + state: "54", attributes: { - unit_of_measurement: '%', - friendly_name: 'Outside Humidity', - device_class: 'humidity' + unit_of_measurement: "%", + friendly_name: "Outside Humidity", + device_class: "humidity", }, - last_changed: '2018-07-19T10:44:45.924273+00:00', - last_updated: '2018-07-19T10:44:45.924273+00:00', + last_changed: "2018-07-19T10:44:45.924273+00:00", + last_updated: "2018-07-19T10:44:45.924273+00:00", }, - 'sensor.conductivity': { - entity_id: 'sensor.conductivity', - state: '1', + "sensor.conductivity": { + entity_id: "sensor.conductivity", + state: "1", attributes: { maximum: 20, minimum: 0, - friendly_name: 'conductivity', - icon: 'mdi:hanger' + friendly_name: "conductivity", + icon: "mdi:hanger", }, - last_changed: '2018-07-19T12:40:28.377305+00:00', - last_updated: '2018-07-19T12:40:28.377305+00:00', + last_changed: "2018-07-19T12:40:28.377305+00:00", + last_updated: "2018-07-19T12:40:28.377305+00:00", }, - 'weather.demo_weather_south': { - entity_id: 'weather.demo_weather_south', - state: 'sunny', + "weather.demo_weather_south": { + entity_id: "weather.demo_weather_south", + state: "sunny", attributes: { temperature: 21.6, humidity: 92, pressure: 1099, wind_speed: 0.5, - attribution: 'Powered by Home Assistant', + attribution: "Powered by Home Assistant", forecast: [ { - datetime: '2018-07-19T16:00:45.924736', - condition: 'rainy', + datetime: "2018-07-19T16:00:45.924736", + condition: "rainy", precipitation: 1, temperature: 22, - templow: 15 + templow: 15, }, { - datetime: '2018-07-19T20:00:45.924736', - condition: 'rainy', + datetime: "2018-07-19T20:00:45.924736", + condition: "rainy", precipitation: 5, temperature: 19, - templow: 8 + templow: 8, }, { - datetime: '2018-07-20T00:00:45.924736', - condition: 'cloudy', + datetime: "2018-07-20T00:00:45.924736", + condition: "cloudy", precipitation: 0, temperature: 15, - templow: 9 + templow: 9, }, { - datetime: '2018-07-20T04:00:45.924736', - condition: 'sunny', + datetime: "2018-07-20T04:00:45.924736", + condition: "sunny", precipitation: 0, temperature: 12, - templow: 6 + templow: 6, }, { - datetime: '2018-07-20T08:00:45.924736', - condition: 'partlycloudy', + datetime: "2018-07-20T08:00:45.924736", + condition: "partlycloudy", precipitation: 2, temperature: 14, - templow: 7 + templow: 7, }, { - datetime: '2018-07-20T12:00:45.924736', - condition: 'rainy', + datetime: "2018-07-20T12:00:45.924736", + condition: "rainy", precipitation: 15, temperature: 18, - templow: 7 + templow: 7, }, { - datetime: '2018-07-20T16:00:45.924736', - condition: 'fog', + datetime: "2018-07-20T16:00:45.924736", + condition: "fog", precipitation: 0.2, temperature: 21, - templow: 12 - } + templow: 12, + }, ], - friendly_name: 'Demo Weather South' + friendly_name: "Demo Weather South", }, - last_changed: '2018-07-19T10:44:45.924818+00:00', - last_updated: '2018-07-19T10:44:45.924818+00:00' + last_changed: "2018-07-19T10:44:45.924818+00:00", + last_updated: "2018-07-19T10:44:45.924818+00:00", }, - 'weather.demo_weather_north': { - entity_id: 'weather.demo_weather_north', - state: 'rainy', + "weather.demo_weather_north": { + entity_id: "weather.demo_weather_north", + state: "rainy", attributes: { temperature: -24, humidity: 54, pressure: 987, wind_speed: 4.8, - attribution: 'Powered by Home Assistant', + attribution: "Powered by Home Assistant", forecast: [ { - datetime: '2018-07-19T16:00:45.925119', - condition: 'snowy', + datetime: "2018-07-19T16:00:45.925119", + condition: "snowy", precipitation: 2, temperature: -23, - templow: -26 + templow: -26, }, { - datetime: '2018-07-19T20:00:45.925119', - condition: 'partlycloudy', + datetime: "2018-07-19T20:00:45.925119", + condition: "partlycloudy", precipitation: 1, temperature: -25, - templow: -26 + templow: -26, }, { - datetime: '2018-07-20T00:00:45.925119', - condition: 'sunny', + datetime: "2018-07-20T00:00:45.925119", + condition: "sunny", precipitation: 0, temperature: -28, - templow: -30 + templow: -30, }, { - datetime: '2018-07-20T04:00:45.925119', - condition: 'sunny', + datetime: "2018-07-20T04:00:45.925119", + condition: "sunny", precipitation: 0.1, temperature: -31, - templow: -31 + templow: -31, }, { - datetime: '2018-07-20T08:00:45.925119', - condition: 'snowy', + datetime: "2018-07-20T08:00:45.925119", + condition: "snowy", precipitation: 4, temperature: -28, - templow: -29 + templow: -29, }, { - datetime: '2018-07-20T12:00:45.925119', - condition: 'sunny', + datetime: "2018-07-20T12:00:45.925119", + condition: "sunny", precipitation: 0.3, temperature: -26, - templow: -28 + templow: -28, }, { - datetime: '2018-07-20T16:00:45.925119', - condition: 'sunny', + datetime: "2018-07-20T16:00:45.925119", + condition: "sunny", precipitation: 0, temperature: -23, - templow: -24 - } + templow: -24, + }, ], - friendly_name: 'Demo Weather North' + friendly_name: "Demo Weather North", }, - last_changed: '2018-07-19T10:44:45.925197+00:00', - last_updated: '2018-07-19T10:44:45.925197+00:00' + last_changed: "2018-07-19T10:44:45.925197+00:00", + last_updated: "2018-07-19T10:44:45.925197+00:00", }, - 'a.demo_mode': { - entity_id: 'a.demo_mode', - state: 'Enabled', + "a.demo_mode": { + entity_id: "a.demo_mode", + state: "Enabled", attributes: {}, - last_changed: '2018-07-19T10:44:45.928682+00:00', - last_updated: '2018-07-19T10:44:45.928682+00:00' + last_changed: "2018-07-19T10:44:45.928682+00:00", + last_updated: "2018-07-19T10:44:45.928682+00:00", }, - 'plant.bonsai': { - entity_id: 'plant.bonsai', - state: 'ok', + "plant.bonsai": { + entity_id: "plant.bonsai", + state: "ok", attributes: { - problem: 'none', + problem: "none", sensors: { - moisture: 'sensor.outside_humidity', - battery: 'sensor.battery', - temperature: 'sensor.outside_temperature', - conductivity: 'sensor.conductivity', - brightness: 'sensor.brightness' + moisture: "sensor.outside_humidity", + battery: "sensor.battery", + temperature: "sensor.outside_temperature", + conductivity: "sensor.conductivity", + brightness: "sensor.brightness", }, unit_of_measurement_dict: { - temperature: '°C', - moisture: '%' + temperature: "°C", + moisture: "%", }, moisture: 54, battery: 2, @@ -295,199 +296,186 @@ export default { conductivity: 1, brightness: 12, max_brightness: 20, - friendly_name: 'Bonsai' + friendly_name: "Bonsai", }, - last_changed: '2018-07-19T10:44:45.939328+00:00', - last_updated: '2018-07-19T12:40:28.379845+00:00' + last_changed: "2018-07-19T10:44:45.939328+00:00", + last_updated: "2018-07-19T12:40:28.379845+00:00", }, - 'media_player.lounge_room': { - entity_id: 'media_player.lounge_room', - state: 'playing', + "media_player.lounge_room": { + entity_id: "media_player.lounge_room", + state: "playing", attributes: { volume_level: 1, is_volume_muted: false, - media_content_id: 'house-of-cards-1', - media_content_type: 'tvshow', + media_content_id: "house-of-cards-1", + media_content_type: "tvshow", media_duration: 3600, - media_title: 'Chapter 1', - media_series_title: 'House of Cards', + media_title: "Chapter 1", + media_series_title: "House of Cards", media_season: 1, media_episode: 1, - app_name: 'Netflix', - source: 'dvd', - sound_mode: 'Dummy Music', - sound_mode_list: [ - 'Dummy Music', - 'Dummy Movie' - ], + app_name: "Netflix", + source: "dvd", + sound_mode: "Dummy Music", + sound_mode_list: ["Dummy Music", "Dummy Movie"], shuffle: false, - friendly_name: 'Lounge room', - entity_picture: '/api/media_player_proxy/media_player.lounge_room?token=20aea624c9d6c83d44e212e60c0795633d2700cde18d60901c6d74b0d063d6bf&cache=cb9d84451faf9351', - supported_features: 117169 + friendly_name: "Lounge room", + entity_picture: + "/api/media_player_proxy/media_player.lounge_room?token=20aea624c9d6c83d44e212e60c0795633d2700cde18d60901c6d74b0d063d6bf&cache=cb9d84451faf9351", + supported_features: 117169, }, - last_changed: '2018-07-19T10:44:45.935593+00:00', - last_updated: '2018-07-19T10:44:45.935593+00:00', + last_changed: "2018-07-19T10:44:45.935593+00:00", + last_updated: "2018-07-19T10:44:45.935593+00:00", }, - 'media_player.bedroom': { - entity_id: 'media_player.bedroom', - state: 'playing', + "media_player.bedroom": { + entity_id: "media_player.bedroom", + state: "playing", attributes: { volume_level: 1, is_volume_muted: false, - media_content_id: 'kxopViU98Xo', - media_content_type: 'movie', + media_content_id: "kxopViU98Xo", + media_content_type: "movie", media_duration: 360000, media_position: 54000.016711, - media_position_updated_at: '2018-07-19T10:44:45.919531+00:00', - media_title: 'Epic sax guy 10 hours', - app_name: 'YouTube', - sound_mode: 'Dummy Music', - sound_mode_list: [ - 'Dummy Music', - 'Dummy Movie' - ], + media_position_updated_at: "2018-07-19T10:44:45.919531+00:00", + media_title: "Epic sax guy 10 hours", + app_name: "YouTube", + sound_mode: "Dummy Music", + sound_mode_list: ["Dummy Music", "Dummy Movie"], shuffle: false, - friendly_name: 'Bedroom', - entity_picture: '/api/media_player_proxy/media_player.bedroom?token=b26ff1a75b0929f6ad578955689815af828229e6cffaf061b8b6fb69c4044976&cache=e4513ed94ec89151', - supported_features: 115597 + friendly_name: "Bedroom", + entity_picture: + "/api/media_player_proxy/media_player.bedroom?token=b26ff1a75b0929f6ad578955689815af828229e6cffaf061b8b6fb69c4044976&cache=e4513ed94ec89151", + supported_features: 115597, }, - last_changed: '2018-07-19T10:44:45.936499+00:00', - last_updated: '2018-07-19T10:44:45.936499+00:00', + last_changed: "2018-07-19T10:44:45.936499+00:00", + last_updated: "2018-07-19T10:44:45.936499+00:00", }, - 'media_player.living_room': { - entity_id: 'media_player.living_room', - state: 'playing', + "media_player.living_room": { + entity_id: "media_player.living_room", + state: "playing", attributes: { volume_level: 1, is_volume_muted: false, - media_content_id: 'eyU3bRy2x44', - media_content_type: 'movie', + media_content_id: "eyU3bRy2x44", + media_content_type: "movie", media_duration: 300, media_position: 45.017773, - media_position_updated_at: '2018-07-19T10:44:45.919514+00:00', - media_title: '♥♥ The Best Fireplace Video (3 hours)', - app_name: 'YouTube', - sound_mode: 'Dummy Music', - sound_mode_list: [ - 'Dummy Music', - 'Dummy Movie' - ], + media_position_updated_at: "2018-07-19T10:44:45.919514+00:00", + media_title: "♥♥ The Best Fireplace Video (3 hours)", + app_name: "YouTube", + sound_mode: "Dummy Music", + sound_mode_list: ["Dummy Music", "Dummy Movie"], shuffle: false, - friendly_name: 'Living Room', - entity_picture: '/api/media_player_proxy/media_player.living_room?token=e925f8db7f7bd1f317e4524dcb8333d60f6019219a3799a22604b5787f243567&cache=bc2ffb49c4f67034', - supported_features: 115597 + friendly_name: "Living Room", + entity_picture: + "/api/media_player_proxy/media_player.living_room?token=e925f8db7f7bd1f317e4524dcb8333d60f6019219a3799a22604b5787f243567&cache=bc2ffb49c4f67034", + supported_features: 115597, }, - last_changed: '2018-07-19T10:44:45.937400+00:00', - last_updated: '2018-07-19T10:44:45.937400+00:00', + last_changed: "2018-07-19T10:44:45.937400+00:00", + last_updated: "2018-07-19T10:44:45.937400+00:00", }, - 'media_player.walkman': { - entity_id: 'media_player.walkman', - state: 'playing', + "media_player.walkman": { + entity_id: "media_player.walkman", + state: "playing", attributes: { volume_level: 1, is_volume_muted: false, - media_content_id: 'bounzz-1', - media_content_type: 'music', + media_content_id: "bounzz-1", + media_content_type: "music", media_duration: 213, - media_title: 'I Wanna Be A Hippy (Flamman & Abraxas Radio Mix)', - media_artist: 'Technohead', - media_album_name: 'Bounzz', + media_title: "I Wanna Be A Hippy (Flamman & Abraxas Radio Mix)", + media_artist: "Technohead", + media_album_name: "Bounzz", media_track: 1, - sound_mode: 'Dummy Music', - sound_mode_list: [ - 'Dummy Music', - 'Dummy Movie' - ], + sound_mode: "Dummy Music", + sound_mode_list: ["Dummy Music", "Dummy Movie"], shuffle: false, - friendly_name: 'Walkman', - entity_picture: '/api/media_player_proxy/media_player.walkman?token=eda2b56fa513fa80f8d9c641941a3702b83e84e239c9ed82efc665a31e80d8fd&cache=62c0c516acbc53a9', - supported_features: 123325 + friendly_name: "Walkman", + entity_picture: + "/api/media_player_proxy/media_player.walkman?token=eda2b56fa513fa80f8d9c641941a3702b83e84e239c9ed82efc665a31e80d8fd&cache=62c0c516acbc53a9", + supported_features: 123325, }, - last_changed: '2018-07-19T10:44:45.938179+00:00', - last_updated: '2018-07-19T10:44:45.938179+00:00', + last_changed: "2018-07-19T10:44:45.938179+00:00", + last_updated: "2018-07-19T10:44:45.938179+00:00", }, - 'input_select.who_cooks': { - entity_id: 'input_select.who_cooks', - state: 'Anne Therese', + "input_select.who_cooks": { + entity_id: "input_select.who_cooks", + state: "Anne Therese", attributes: { - options: [ - 'Paulus', - 'Anne Therese' - ], - friendly_name: 'Cook today', - icon: 'mdi:panda' + options: ["Paulus", "Anne Therese"], + friendly_name: "Cook today", + icon: "mdi:panda", }, - last_changed: '2018-07-19T10:44:46.105361+00:00', - last_updated: '2018-07-19T10:44:46.105361+00:00', + last_changed: "2018-07-19T10:44:46.105361+00:00", + last_updated: "2018-07-19T10:44:46.105361+00:00", }, - 'input_boolean.notify': { - entity_id: 'input_boolean.notify', - state: 'off', + "input_boolean.notify": { + entity_id: "input_boolean.notify", + state: "off", attributes: { - friendly_name: 'Notify Anne Therese is home', - icon: 'mdi:car' + friendly_name: "Notify Anne Therese is home", + icon: "mdi:car", }, - last_changed: '2018-07-19T10:44:46.105940+00:00', - last_updated: '2018-07-19T10:44:46.105940+00:00', + last_changed: "2018-07-19T10:44:46.105940+00:00", + last_updated: "2018-07-19T10:44:46.105940+00:00", }, - 'weblink.router': { - entity_id: 'weblink.router', - state: 'http://192.168.1.1', + "weblink.router": { + entity_id: "weblink.router", + state: "http://192.168.1.1", attributes: { - friendly_name: 'Router' + friendly_name: "Router", }, - last_changed: '2018-07-19T10:44:46.107286+00:00', - last_updated: '2018-07-19T10:44:46.107286+00:00', + last_changed: "2018-07-19T10:44:46.107286+00:00", + last_updated: "2018-07-19T10:44:46.107286+00:00", }, - 'group.all_plants': { - entity_id: 'group.all_plants', - state: 'ok', + "group.all_plants": { + entity_id: "group.all_plants", + state: "ok", attributes: { - entity_id: [ - 'plant.bonsai' - ], + entity_id: ["plant.bonsai"], order: 0, auto: true, - friendly_name: 'all plants', - hidden: true + friendly_name: "all plants", + hidden: true, }, - last_changed: '2018-07-19T10:44:46.193703+00:00', - last_updated: '2018-07-19T10:44:46.193703+00:00' + last_changed: "2018-07-19T10:44:46.193703+00:00", + last_updated: "2018-07-19T10:44:46.193703+00:00", }, - 'alarm_control_panel.alarm': { - entity_id: 'alarm_control_panel.alarm', - state: 'disarmed', + "alarm_control_panel.alarm": { + entity_id: "alarm_control_panel.alarm", + state: "disarmed", attributes: { - code_format: 'Number', + code_format: "Number", changed_by: null, - friendly_name: 'Alarm' + friendly_name: "Alarm", }, - last_changed: '2018-07-19T10:44:46.198517+00:00', - last_updated: '2018-07-19T10:44:46.198517+00:00', + last_changed: "2018-07-19T10:44:46.198517+00:00", + last_updated: "2018-07-19T10:44:46.198517+00:00", }, - 'binary_sensor.basement_floor_wet': { - entity_id: 'binary_sensor.basement_floor_wet', - state: 'off', + "binary_sensor.basement_floor_wet": { + entity_id: "binary_sensor.basement_floor_wet", + state: "off", attributes: { - friendly_name: 'Basement Floor Wet', - device_class: 'moisture' + friendly_name: "Basement Floor Wet", + device_class: "moisture", }, - last_changed: '2018-07-19T10:44:46.198923+00:00', - last_updated: '2018-07-19T10:44:46.198923+00:00', + last_changed: "2018-07-19T10:44:46.198923+00:00", + last_updated: "2018-07-19T10:44:46.198923+00:00", }, - 'binary_sensor.movement_backyard': { - entity_id: 'binary_sensor.movement_backyard', - state: 'on', + "binary_sensor.movement_backyard": { + entity_id: "binary_sensor.movement_backyard", + state: "on", attributes: { - friendly_name: 'Movement Backyard', - device_class: 'motion' + friendly_name: "Movement Backyard", + device_class: "motion", }, - last_changed: '2018-07-19T10:44:46.199163+00:00', - last_updated: '2018-07-19T10:44:46.199163+00:00', + last_changed: "2018-07-19T10:44:46.199163+00:00", + last_updated: "2018-07-19T10:44:46.199163+00:00", }, - 'climate.ecobee': { - entity_id: 'climate.ecobee', - state: 'auto', + "climate.ecobee": { + entity_id: "climate.ecobee", + state: "auto", attributes: { current_temperature: 23, min_temp: 7, @@ -495,40 +483,23 @@ export default { temperature: null, target_temp_high: 24, target_temp_low: 21, - fan_mode: 'Auto Low', - fan_list: [ - 'On Low', - 'On High', - 'Auto Low', - 'Auto High', - 'Off' - ], - operation_mode: 'auto', - operation_list: [ - 'heat', - 'cool', - 'auto', - 'off' - ], - hold_mode: 'home', - swing_mode: 'Auto', - swing_list: [ - 'Auto', - '1', - '2', - '3', - 'Off' - ], - unit_of_measurement: '°C', - friendly_name: 'Ecobee', - supported_features: 1014 + fan_mode: "Auto Low", + fan_list: ["On Low", "On High", "Auto Low", "Auto High", "Off"], + operation_mode: "auto", + operation_list: ["heat", "cool", "auto", "off"], + hold_mode: "home", + swing_mode: "Auto", + swing_list: ["Auto", "1", "2", "3", "Off"], + unit_of_measurement: "°C", + friendly_name: "Ecobee", + supported_features: 1014, }, - last_changed: '2018-07-19T10:44:46.200333+00:00', - last_updated: '2018-07-19T10:44:46.200333+00:00', + last_changed: "2018-07-19T10:44:46.200333+00:00", + last_updated: "2018-07-19T10:44:46.200333+00:00", }, - 'climate.hvac': { - entity_id: 'climate.hvac', - state: 'cool', + "climate.hvac": { + entity_id: "climate.hvac", + state: "cool", attributes: { current_temperature: 22, min_temp: 7, @@ -538,715 +509,637 @@ export default { current_humidity: 54, min_humidity: 30, max_humidity: 99, - fan_mode: 'On High', - fan_list: [ - 'On Low', - 'On High', - 'Auto Low', - 'Auto High', - 'Off' - ], - operation_mode: 'cool', - operation_list: [ - 'heat', - 'cool', - 'auto', - 'off' - ], - swing_mode: 'Off', - swing_list: [ - 'Auto', - '1', - '2', - '3', - 'Off' - ], - away_mode: 'on', - aux_heat: 'off', - unit_of_measurement: '°C', - friendly_name: 'Hvac', - supported_features: 3833 + fan_mode: "On High", + fan_list: ["On Low", "On High", "Auto Low", "Auto High", "Off"], + operation_mode: "cool", + operation_list: ["heat", "cool", "auto", "off"], + swing_mode: "Off", + swing_list: ["Auto", "1", "2", "3", "Off"], + away_mode: "on", + aux_heat: "off", + unit_of_measurement: "°C", + friendly_name: "Hvac", + supported_features: 3833, }, - last_changed: '2018-07-19T10:44:46.200650+00:00', - last_updated: '2018-07-19T10:44:46.200650+00:00', + last_changed: "2018-07-19T10:44:46.200650+00:00", + last_updated: "2018-07-19T10:44:46.200650+00:00", }, - 'climate.heatpump': { - entity_id: 'climate.heatpump', - state: 'heat', + "climate.heatpump": { + entity_id: "climate.heatpump", + state: "heat", attributes: { current_temperature: 25, min_temp: 7, max_temp: 35, temperature: 20, - operation_mode: 'heat', - operation_list: [ - 'heat', - 'cool', - 'auto', - 'off' - ], - unit_of_measurement: '°C', - friendly_name: 'HeatPump', - supported_features: 4273 + operation_mode: "heat", + operation_list: ["heat", "cool", "auto", "off"], + unit_of_measurement: "°C", + friendly_name: "HeatPump", + supported_features: 4273, }, - last_changed: '2018-07-19T10:44:46.200946+00:00', - last_updated: '2018-07-19T10:44:46.200946+00:00', + last_changed: "2018-07-19T10:44:46.200946+00:00", + last_updated: "2018-07-19T10:44:46.200946+00:00", }, - 'mailbox.demomailbox': { - entity_id: 'mailbox.demomailbox', - state: '10', + "mailbox.demomailbox": { + entity_id: "mailbox.demomailbox", + state: "10", attributes: { - friendly_name: 'DemoMailbox' + friendly_name: "DemoMailbox", }, - last_changed: '2018-07-19T10:45:16.555210+00:00', - last_updated: '2018-07-19T10:45:16.555210+00:00', + last_changed: "2018-07-19T10:45:16.555210+00:00", + last_updated: "2018-07-19T10:45:16.555210+00:00", }, - 'input_select.living_room_preset': { - entity_id: 'input_select.living_room_preset', - state: 'Visitors', + "input_select.living_room_preset": { + entity_id: "input_select.living_room_preset", + state: "Visitors", attributes: { - options: [ - 'Visitors', - 'Visitors with kids', - 'Home Alone' - ] + options: ["Visitors", "Visitors with kids", "Home Alone"], }, - last_changed: '2018-07-19T10:44:46.211150+00:00', - last_updated: '2018-07-19T10:44:46.211150+00:00', + last_changed: "2018-07-19T10:44:46.211150+00:00", + last_updated: "2018-07-19T10:44:46.211150+00:00", }, - 'camera.demo_camera': { - entity_id: 'camera.demo_camera', - state: 'idle', + "camera.demo_camera": { + entity_id: "camera.demo_camera", + state: "idle", attributes: { - access_token: '2f5bb163fb91cd8770a9494fa5e7eab172d8d34f4aba806eb6b59411b8c720b8', - friendly_name: 'Demo camera', - entity_picture: '/api/camera_proxy/camera.demo_camera?token=2f5bb163fb91cd8770a9494fa5e7eab172d8d34f4aba806eb6b59411b8c720b8' + access_token: + "2f5bb163fb91cd8770a9494fa5e7eab172d8d34f4aba806eb6b59411b8c720b8", + friendly_name: "Demo camera", + entity_picture: + "/api/camera_proxy/camera.demo_camera?token=2f5bb163fb91cd8770a9494fa5e7eab172d8d34f4aba806eb6b59411b8c720b8", }, - last_changed: '2018-07-19T10:44:46.217296+00:00', - last_updated: '2018-07-19T12:37:34.378986+00:00' + last_changed: "2018-07-19T10:44:46.217296+00:00", + last_updated: "2018-07-19T12:37:34.378986+00:00", }, - 'cover.garage_door': { - entity_id: 'cover.garage_door', - state: 'closed', + "cover.garage_door": { + entity_id: "cover.garage_door", + state: "closed", attributes: { - friendly_name: 'Garage Door', + friendly_name: "Garage Door", supported_features: 3, - device_class: 'garage' + device_class: "garage", }, - last_changed: '2018-07-19T10:44:46.218790+00:00', - last_updated: '2018-07-19T10:44:46.218790+00:00', + last_changed: "2018-07-19T10:44:46.218790+00:00", + last_updated: "2018-07-19T10:44:46.218790+00:00", }, - 'cover.living_room_window': { - entity_id: 'cover.living_room_window', - state: 'open', + "cover.living_room_window": { + entity_id: "cover.living_room_window", + state: "open", attributes: { current_position: 70, current_tilt_position: 50, - friendly_name: 'Living Room Window', - supported_features: 255 + friendly_name: "Living Room Window", + supported_features: 255, }, - last_changed: '2018-07-19T10:44:46.220347+00:00', - last_updated: '2018-07-19T10:44:46.220347+00:00', + last_changed: "2018-07-19T10:44:46.220347+00:00", + last_updated: "2018-07-19T10:44:46.220347+00:00", }, - 'cover.hall_window': { - entity_id: 'cover.hall_window', - state: 'open', + "cover.hall_window": { + entity_id: "cover.hall_window", + state: "open", attributes: { current_position: 10, - friendly_name: 'Hall Window', - supported_features: 15 + friendly_name: "Hall Window", + supported_features: 15, }, - last_changed: '2018-07-19T10:44:46.281104+00:00', - last_updated: '2018-07-19T10:44:46.281104+00:00', + last_changed: "2018-07-19T10:44:46.281104+00:00", + last_updated: "2018-07-19T10:44:46.281104+00:00", }, - 'cover.kitchen_window': { - entity_id: 'cover.kitchen_window', - state: 'closed', + "cover.kitchen_window": { + entity_id: "cover.kitchen_window", + state: "closed", attributes: { - friendly_name: 'Kitchen Window', - supported_features: 11 + friendly_name: "Kitchen Window", + supported_features: 11, }, - last_changed: '2018-07-19T10:44:46.281449+00:00', - last_updated: '2018-07-19T10:44:46.281449+00:00', + last_changed: "2018-07-19T10:44:46.281449+00:00", + last_updated: "2018-07-19T10:44:46.281449+00:00", }, - 'fan.living_room_fan': { - entity_id: 'fan.living_room_fan', - state: 'off', + "fan.living_room_fan": { + entity_id: "fan.living_room_fan", + state: "off", attributes: { - speed: 'off', - speed_list: [ - 'off', - 'low', - 'medium', - 'high' - ], + speed: "off", + speed_list: ["off", "low", "medium", "high"], oscillating: false, - direction: 'forward', - friendly_name: 'Living Room Fan', - supported_features: 7 + direction: "forward", + friendly_name: "Living Room Fan", + supported_features: 7, }, - last_changed: '2018-07-19T10:44:46.281761+00:00', - last_updated: '2018-07-19T10:44:46.281761+00:00', + last_changed: "2018-07-19T10:44:46.281761+00:00", + last_updated: "2018-07-19T10:44:46.281761+00:00", }, - 'fan.ceiling_fan': { - entity_id: 'fan.ceiling_fan', - state: 'off', + "fan.ceiling_fan": { + entity_id: "fan.ceiling_fan", + state: "off", attributes: { - speed: 'off', - speed_list: [ - 'off', - 'low', - 'medium', - 'high' - ], - friendly_name: 'Ceiling Fan', - supported_features: 1 + speed: "off", + speed_list: ["off", "low", "medium", "high"], + friendly_name: "Ceiling Fan", + supported_features: 1, }, - last_changed: '2018-07-19T10:44:46.282008+00:00', - last_updated: '2018-07-19T10:44:46.282008+00:00', + last_changed: "2018-07-19T10:44:46.282008+00:00", + last_updated: "2018-07-19T10:44:46.282008+00:00", }, - 'light.kitchen_lights': { - entity_id: 'light.kitchen_lights', - state: 'on', + "light.kitchen_lights": { + entity_id: "light.kitchen_lights", + state: "on", attributes: { min_mireds: 153, max_mireds: 500, brightness: 180, color_temp: 240, - hs_color: [ - 345, - 75 - ], - rgb_color: [ - 255, - 63, - 111 - ], - xy_color: [ - 0.59, - 0.274 - ], + hs_color: [345, 75], + rgb_color: [255, 63, 111], + xy_color: [0.59, 0.274], white_value: 200, - friendly_name: 'Kitchen Lights', - supported_features: 151 + friendly_name: "Kitchen Lights", + supported_features: 151, }, - last_changed: '2018-07-19T10:44:46.282257+00:00', - last_updated: '2018-07-19T10:44:46.282257+00:00', + last_changed: "2018-07-19T10:44:46.282257+00:00", + last_updated: "2018-07-19T10:44:46.282257+00:00", }, - 'light.bed_light': { - entity_id: 'light.bed_light', - state: 'off', + "light.bed_light": { + entity_id: "light.bed_light", + state: "off", attributes: { min_mireds: 153, max_mireds: 500, - friendly_name: 'Bed Light', - supported_features: 151 + friendly_name: "Bed Light", + supported_features: 151, }, - last_changed: '2018-07-19T10:44:46.282478+00:00', - last_updated: '2018-07-19T10:44:46.282478+00:00', + last_changed: "2018-07-19T10:44:46.282478+00:00", + last_updated: "2018-07-19T10:44:46.282478+00:00", }, - 'light.ceiling_lights': { - entity_id: 'light.ceiling_lights', - state: 'on', + "light.ceiling_lights": { + entity_id: "light.ceiling_lights", + state: "on", attributes: { min_mireds: 153, max_mireds: 500, brightness: 180, color_temp: 380, - hs_color: [ - 56, - 86 - ], - rgb_color: [ - 255, - 240, - 35 - ], - xy_color: [ - 0.459, - 0.496 - ], + hs_color: [56, 86], + rgb_color: [255, 240, 35], + xy_color: [0.459, 0.496], white_value: 200, - friendly_name: 'Ceiling Lights', - supported_features: 151 + friendly_name: "Ceiling Lights", + supported_features: 151, }, - last_changed: '2018-07-19T10:44:46.282696+00:00', - last_updated: '2018-07-19T10:44:46.282696+00:00', + last_changed: "2018-07-19T10:44:46.282696+00:00", + last_updated: "2018-07-19T10:44:46.282696+00:00", }, - 'lock.openable_lock': { - entity_id: 'lock.openable_lock', - state: 'locked', + "lock.openable_lock": { + entity_id: "lock.openable_lock", + state: "locked", attributes: { - friendly_name: 'Openable Lock', - supported_features: 1 + friendly_name: "Openable Lock", + supported_features: 1, }, - last_changed: '2018-07-19T10:44:46.282949+00:00', - last_updated: '2018-07-19T10:44:46.282949+00:00', + last_changed: "2018-07-19T10:44:46.282949+00:00", + last_updated: "2018-07-19T10:44:46.282949+00:00", }, - 'lock.kitchen_door': { - entity_id: 'lock.kitchen_door', - state: 'unlocked', + "lock.kitchen_door": { + entity_id: "lock.kitchen_door", + state: "unlocked", attributes: { - friendly_name: 'Kitchen Door' + friendly_name: "Kitchen Door", }, - last_changed: '2018-07-19T10:44:46.283175+00:00', - last_updated: '2018-07-19T10:44:46.283175+00:00', + last_changed: "2018-07-19T10:44:46.283175+00:00", + last_updated: "2018-07-19T10:44:46.283175+00:00", }, - 'lock.front_door': { - entity_id: 'lock.front_door', - state: 'locked', + "lock.front_door": { + entity_id: "lock.front_door", + state: "locked", attributes: { - friendly_name: 'Front Door' + friendly_name: "Front Door", }, - last_changed: '2018-07-19T10:44:46.283396+00:00', - last_updated: '2018-07-19T10:44:46.283396+00:00', + last_changed: "2018-07-19T10:44:46.283396+00:00", + last_updated: "2018-07-19T10:44:46.283396+00:00", }, - 'switch.decorative_lights': { - entity_id: 'switch.decorative_lights', - state: 'on', + "switch.decorative_lights": { + entity_id: "switch.decorative_lights", + state: "on", attributes: { current_power_w: 100, today_energy_kwh: 15, - friendly_name: 'Decorative Lights', - assumed_state: true + friendly_name: "Decorative Lights", + assumed_state: true, }, - last_changed: '2018-07-19T11:33:15.735386+00:00', - last_updated: '2018-07-19T11:33:15.735386+00:00', + last_changed: "2018-07-19T11:33:15.735386+00:00", + last_updated: "2018-07-19T11:33:15.735386+00:00", }, - 'switch.ac': { - entity_id: 'switch.ac', - state: 'off', + "switch.ac": { + entity_id: "switch.ac", + state: "off", attributes: { today_energy_kwh: 15, - friendly_name: 'AC', - icon: 'mdi:air-conditioner' + friendly_name: "AC", + icon: "mdi:air-conditioner", }, - last_changed: '2018-07-19T10:44:46.283901+00:00', - last_updated: '2018-07-19T10:44:46.283901+00:00', + last_changed: "2018-07-19T10:44:46.283901+00:00", + last_updated: "2018-07-19T10:44:46.283901+00:00", }, - 'device_tracker.demo_paulus': { - entity_id: 'device_tracker.demo_paulus', - state: 'not_home', + "device_tracker.demo_paulus": { + entity_id: "device_tracker.demo_paulus", + state: "not_home", attributes: { - source_type: 'gps', + source_type: "gps", latitude: 32.877105, longitude: 117.232185, gps_accuracy: 91, battery: 71, - friendly_name: 'Paulus' + friendly_name: "Paulus", }, - last_changed: '2018-07-19T10:44:46.287874+00:00', - last_updated: '2018-07-19T10:44:46.287874+00:00', + last_changed: "2018-07-19T10:44:46.287874+00:00", + last_updated: "2018-07-19T10:44:46.287874+00:00", }, - 'device_tracker.demo_anne_therese': { - entity_id: 'device_tracker.demo_anne_therese', - state: 'not_home', + "device_tracker.demo_anne_therese": { + entity_id: "device_tracker.demo_anne_therese", + state: "not_home", attributes: { - source_type: 'gps', + source_type: "gps", latitude: 32.876194999999996, longitude: 117.236015, gps_accuracy: 63, battery: 33, - friendly_name: 'Anne Therese' + friendly_name: "Anne Therese", }, - last_changed: '2018-07-19T10:44:46.288213+00:00', - last_updated: '2018-07-19T10:44:46.288213+00:00', + last_changed: "2018-07-19T10:44:46.288213+00:00", + last_updated: "2018-07-19T10:44:46.288213+00:00", }, - 'device_tracker.demo_home_boy': { - entity_id: 'device_tracker.demo_home_boy', - state: 'not_home', + "device_tracker.demo_home_boy": { + entity_id: "device_tracker.demo_home_boy", + state: "not_home", attributes: { - source_type: 'gps', + source_type: "gps", latitude: 32.87334, longitude: 117.22745, gps_accuracy: 20, battery: 53, - friendly_name: 'Home Boy' + friendly_name: "Home Boy", }, - last_changed: '2018-07-19T10:44:46.288533+00:00', - last_updated: '2018-07-19T10:44:46.288533+00:00', + last_changed: "2018-07-19T10:44:46.288533+00:00", + last_updated: "2018-07-19T10:44:46.288533+00:00", }, - 'calendar.calendar_2': { - entity_id: 'calendar.calendar_2', - state: 'off', + "calendar.calendar_2": { + entity_id: "calendar.calendar_2", + state: "off", attributes: { - message: '', + message: "", all_day: false, offset_reached: false, start_time: null, end_time: null, location: null, description: null, - friendly_name: 'Calendar 2' + friendly_name: "Calendar 2", }, - last_changed: '2018-07-19T11:27:25.017141+00:00', - last_updated: '2018-07-19T11:27:25.017141+00:00', + last_changed: "2018-07-19T11:27:25.017141+00:00", + last_updated: "2018-07-19T11:27:25.017141+00:00", }, - 'calendar.calendar_1': { - entity_id: 'calendar.calendar_1', - state: 'off', + "calendar.calendar_1": { + entity_id: "calendar.calendar_1", + state: "off", attributes: { - message: '', + message: "", all_day: false, offset_reached: false, start_time: null, end_time: null, location: null, description: null, - friendly_name: 'Calendar 1' + friendly_name: "Calendar 1", }, - last_changed: '2018-07-19T12:15:21.378222+00:00', - last_updated: '2018-07-19T12:15:21.378222+00:00', + last_changed: "2018-07-19T12:15:21.378222+00:00", + last_updated: "2018-07-19T12:15:21.378222+00:00", }, - 'group.all_covers': { - entity_id: 'group.all_covers', - state: 'open', + "group.all_covers": { + entity_id: "group.all_covers", + state: "open", attributes: { entity_id: [ - 'cover.garage_door', - 'cover.hall_window', - 'cover.kitchen_window', - 'cover.living_room_window' + "cover.garage_door", + "cover.hall_window", + "cover.kitchen_window", + "cover.living_room_window", ], order: 1, auto: true, - friendly_name: 'all covers', - hidden: true - }, - last_changed: '2018-07-19T10:44:46.430361+00:00', - last_updated: '2018-07-19T10:44:46.430361+00:00' - }, - 'group.all_fans': { - entity_id: 'group.all_fans', - state: 'off', - attributes: { - entity_id: [ - 'fan.ceiling_fan', - 'fan.living_room_fan' - ], - order: 1, - auto: true, - friendly_name: 'all fans', - hidden: true - }, - last_changed: '2018-07-19T10:44:46.430643+00:00', - last_updated: '2018-07-19T10:44:46.430643+00:00' - }, - 'group.all_lights': { - entity_id: 'group.all_lights', - state: 'on', - attributes: { - entity_id: [ - 'light.bed_light', - 'light.ceiling_lights', - 'light.kitchen_lights' - ], - order: 1, - auto: true, - friendly_name: 'all lights', - hidden: true - }, - last_changed: '2018-07-19T10:44:46.430879+00:00', - last_updated: '2018-07-19T10:44:46.430879+00:00' - }, - 'group.all_locks': { - entity_id: 'group.all_locks', - state: 'locked', - attributes: { - entity_id: [ - 'lock.front_door', - 'lock.kitchen_door', - 'lock.openable_lock' - ], - order: 1, - auto: true, - friendly_name: 'all locks', - hidden: true - }, - last_changed: '2018-07-19T10:44:46.431112+00:00', - last_updated: '2018-07-19T10:44:46.431112+00:00' - }, - 'group.all_switches': { - entity_id: 'group.all_switches', - state: 'on', - attributes: { - entity_id: [ - 'switch.ac', - 'switch.decorative_lights' - ], - order: 1, - auto: true, - friendly_name: 'all switches', + friendly_name: "all covers", hidden: true, - assumed_state: true }, - last_changed: '2018-07-19T11:33:15.736167+00:00', - last_updated: '2018-07-19T11:33:15.736167+00:00' + last_changed: "2018-07-19T10:44:46.430361+00:00", + last_updated: "2018-07-19T10:44:46.430361+00:00", }, - 'group.calendar': { - entity_id: 'group.calendar', - state: 'off', + "group.all_fans": { + entity_id: "group.all_fans", + state: "off", + attributes: { + entity_id: ["fan.ceiling_fan", "fan.living_room_fan"], + order: 1, + auto: true, + friendly_name: "all fans", + hidden: true, + }, + last_changed: "2018-07-19T10:44:46.430643+00:00", + last_updated: "2018-07-19T10:44:46.430643+00:00", + }, + "group.all_lights": { + entity_id: "group.all_lights", + state: "on", attributes: { entity_id: [ - 'calendar.calendar_1', - 'calendar.calendar_2' + "light.bed_light", + "light.ceiling_lights", + "light.kitchen_lights", + ], + order: 1, + auto: true, + friendly_name: "all lights", + hidden: true, + }, + last_changed: "2018-07-19T10:44:46.430879+00:00", + last_updated: "2018-07-19T10:44:46.430879+00:00", + }, + "group.all_locks": { + entity_id: "group.all_locks", + state: "locked", + attributes: { + entity_id: ["lock.front_door", "lock.kitchen_door", "lock.openable_lock"], + order: 1, + auto: true, + friendly_name: "all locks", + hidden: true, + }, + last_changed: "2018-07-19T10:44:46.431112+00:00", + last_updated: "2018-07-19T10:44:46.431112+00:00", + }, + "group.all_switches": { + entity_id: "group.all_switches", + state: "on", + attributes: { + entity_id: ["switch.ac", "switch.decorative_lights"], + order: 1, + auto: true, + friendly_name: "all switches", + hidden: true, + assumed_state: true, + }, + last_changed: "2018-07-19T11:33:15.736167+00:00", + last_updated: "2018-07-19T11:33:15.736167+00:00", + }, + "group.calendar": { + entity_id: "group.calendar", + state: "off", + attributes: { + entity_id: ["calendar.calendar_1", "calendar.calendar_2"], + order: 6, + auto: true, + friendly_name: "calendar", + hidden: true, + }, + last_changed: "2018-07-19T12:15:21.378971+00:00", + last_updated: "2018-07-19T12:15:21.378971+00:00", + }, + "group.all_devices": { + entity_id: "group.all_devices", + state: "not_home", + attributes: { + entity_id: [ + "device_tracker.demo_paulus", + "device_tracker.demo_anne_therese", + "device_tracker.demo_home_boy", ], order: 6, auto: true, - friendly_name: 'calendar', - hidden: true + friendly_name: "all devices", + hidden: true, }, - last_changed: '2018-07-19T12:15:21.378971+00:00', - last_updated: '2018-07-19T12:15:21.378971+00:00' + last_changed: "2018-07-19T10:44:46.435615+00:00", + last_updated: "2018-07-19T10:44:46.435615+00:00", }, - 'group.all_devices': { - entity_id: 'group.all_devices', - state: 'not_home', - attributes: { - entity_id: [ - 'device_tracker.demo_paulus', - 'device_tracker.demo_anne_therese', - 'device_tracker.demo_home_boy' - ], - order: 6, - auto: true, - friendly_name: 'all devices', - hidden: true - }, - last_changed: '2018-07-19T10:44:46.435615+00:00', - last_updated: '2018-07-19T10:44:46.435615+00:00' - }, - 'image_processing.demo_alpr': { - entity_id: 'image_processing.demo_alpr', - state: 'AC3829', + "image_processing.demo_alpr": { + entity_id: "image_processing.demo_alpr", + state: "AC3829", attributes: { plates: { AC3829: 98.3, BE392034: 95.5, CD02394: 93.4, - DF923043: 90.8 + DF923043: 90.8, }, vehicles: 1, - friendly_name: 'Demo Alpr', - device_class: 'alpr' + friendly_name: "Demo Alpr", + device_class: "alpr", }, - last_changed: '2018-07-19T10:44:56.654838+00:00', - last_updated: '2018-07-19T10:44:56.654838+00:00', + last_changed: "2018-07-19T10:44:56.654838+00:00", + last_updated: "2018-07-19T10:44:56.654838+00:00", }, - 'image_processing.demo_face': { - entity_id: 'image_processing.demo_face', - state: 'Hans', + "image_processing.demo_face": { + entity_id: "image_processing.demo_face", + state: "Hans", attributes: { faces: [ { confidence: 98.34, - name: 'Hans', + name: "Hans", age: 16, - gender: 'male', - entity_id: 'image_processing.demo_face' + gender: "male", + entity_id: "image_processing.demo_face", }, { - name: 'Helena', + name: "Helena", age: 28, - gender: 'female', - entity_id: 'image_processing.demo_face' + gender: "female", + entity_id: "image_processing.demo_face", }, { confidence: 62.53, - name: 'Luna' - } + name: "Luna", + }, ], total_faces: 4, - friendly_name: 'Demo Face', - device_class: 'face' + friendly_name: "Demo Face", + device_class: "face", }, - last_changed: '2018-07-19T10:44:56.641372+00:00', - last_updated: '2018-07-19T10:44:56.641372+00:00', + last_changed: "2018-07-19T10:44:56.641372+00:00", + last_updated: "2018-07-19T10:44:56.641372+00:00", }, - 'persistent_notification.notification_2': { - entity_id: 'persistent_notification.notification_2', - state: 'notifying', + "persistent_notification.notification_2": { + entity_id: "persistent_notification.notification_2", + state: "notifying", attributes: { - title: 'Example Notification', - message: 'This is an example of a persistent notification.' + title: "Example Notification", + message: "This is an example of a persistent notification.", }, - last_changed: '2018-07-19T10:44:46.442972+00:00', - last_updated: '2018-07-19T10:44:46.442972+00:00' + last_changed: "2018-07-19T10:44:46.442972+00:00", + last_updated: "2018-07-19T10:44:46.442972+00:00", }, - 'group.living_room': { - entity_id: 'group.living_room', - state: 'on', + "group.living_room": { + entity_id: "group.living_room", + state: "on", attributes: { entity_id: [ - 'light.ceiling_lights', - 'switch.ac', - 'input_select.living_room_preset', - 'cover.living_room_window', - 'media_player.living_room', - 'scene.romantic_lights' + "light.ceiling_lights", + "switch.ac", + "input_select.living_room_preset", + "cover.living_room_window", + "media_player.living_room", + "scene.romantic_lights", ], order: 8, - friendly_name: 'Living Room' + friendly_name: "Living Room", }, - last_changed: '2018-07-19T10:44:46.453731+00:00', - last_updated: '2018-07-19T10:44:46.453731+00:00', + last_changed: "2018-07-19T10:44:46.453731+00:00", + last_updated: "2018-07-19T10:44:46.453731+00:00", }, - 'group.bedroom': { - entity_id: 'group.bedroom', - state: 'on', + "group.bedroom": { + entity_id: "group.bedroom", + state: "on", attributes: { entity_id: [ - 'light.bed_light', - 'switch.decorative_lights', - 'media_player.bedroom', - 'input_number.noise_allowance' + "light.bed_light", + "switch.decorative_lights", + "media_player.bedroom", + "input_number.noise_allowance", ], order: 8, - friendly_name: 'Bedroom', - assumed_state: true + friendly_name: "Bedroom", + assumed_state: true, }, - last_changed: '2018-07-19T11:33:15.736625+00:00', - last_updated: '2018-07-19T11:33:15.736625+00:00', + last_changed: "2018-07-19T11:33:15.736625+00:00", + last_updated: "2018-07-19T11:33:15.736625+00:00", }, - 'group.kitchen': { - entity_id: 'group.kitchen', - state: 'on', + "group.kitchen": { + entity_id: "group.kitchen", + state: "on", attributes: { entity_id: [ - 'light.kitchen_lights', - 'cover.kitchen_window', - 'lock.kitchen_door' + "light.kitchen_lights", + "cover.kitchen_window", + "lock.kitchen_door", ], order: 8, - friendly_name: 'Kitchen' + friendly_name: "Kitchen", }, - last_changed: '2018-07-19T10:44:46.455730+00:00', - last_updated: '2018-07-19T10:44:46.455730+00:00', + last_changed: "2018-07-19T10:44:46.455730+00:00", + last_updated: "2018-07-19T10:44:46.455730+00:00", }, - 'group.doors': { - entity_id: 'group.doors', - state: 'locked', + "group.doors": { + entity_id: "group.doors", + state: "locked", attributes: { entity_id: [ - 'lock.front_door', - 'lock.kitchen_door', - 'garage_door.right_garage_door', - 'garage_door.left_garage_door' + "lock.front_door", + "lock.kitchen_door", + "garage_door.right_garage_door", + "garage_door.left_garage_door", ], order: 8, - friendly_name: 'Doors' + friendly_name: "Doors", }, - last_changed: '2018-07-19T10:44:46.509528+00:00', - last_updated: '2018-07-19T10:44:46.509528+00:00', + last_changed: "2018-07-19T10:44:46.509528+00:00", + last_updated: "2018-07-19T10:44:46.509528+00:00", }, - 'group.automations': { - entity_id: 'group.automations', - state: 'off', + "group.automations": { + entity_id: "group.automations", + state: "off", + attributes: { + entity_id: ["input_select.who_cooks", "input_boolean.notify"], + order: 8, + friendly_name: "Automations", + }, + last_changed: "2018-07-19T10:44:46.509900+00:00", + last_updated: "2018-07-19T10:44:46.509900+00:00", + }, + "group.people": { + entity_id: "group.people", + state: "not_home", attributes: { entity_id: [ - 'input_select.who_cooks', - 'input_boolean.notify' + "device_tracker.demo_anne_therese", + "device_tracker.demo_home_boy", + "device_tracker.demo_paulus", ], order: 8, - friendly_name: 'Automations' + friendly_name: "People", }, - last_changed: '2018-07-19T10:44:46.509900+00:00', - last_updated: '2018-07-19T10:44:46.509900+00:00', + last_changed: "2018-07-19T10:44:46.510172+00:00", + last_updated: "2018-07-19T10:44:46.510172+00:00", }, - 'group.people': { - entity_id: 'group.people', - state: 'not_home', + "group.downstairs": { + entity_id: "group.downstairs", + state: "on", attributes: { entity_id: [ - 'device_tracker.demo_anne_therese', - 'device_tracker.demo_home_boy', - 'device_tracker.demo_paulus' - ], - order: 8, - friendly_name: 'People' - }, - last_changed: '2018-07-19T10:44:46.510172+00:00', - last_updated: '2018-07-19T10:44:46.510172+00:00', - }, - 'group.downstairs': { - entity_id: 'group.downstairs', - state: 'on', - attributes: { - entity_id: [ - 'group.living_room', - 'group.kitchen', - 'scene.romantic_lights', - 'cover.kitchen_window', - 'cover.living_room_window', - 'group.doors', - 'climate.ecobee' + "group.living_room", + "group.kitchen", + "scene.romantic_lights", + "cover.kitchen_window", + "cover.living_room_window", + "group.doors", + "climate.ecobee", ], order: 8, view: true, - friendly_name: 'Downstairs', - hidden: true + friendly_name: "Downstairs", + hidden: true, }, - last_changed: '2018-07-19T10:44:46.510448+00:00', - last_updated: '2018-07-19T10:44:46.510448+00:00', + last_changed: "2018-07-19T10:44:46.510448+00:00", + last_updated: "2018-07-19T10:44:46.510448+00:00", }, - 'history_graph.recent_switches': { - entity_id: 'history_graph.recent_switches', - state: 'unknown', + "history_graph.recent_switches": { + entity_id: "history_graph.recent_switches", + state: "unknown", attributes: { hours_to_show: 1, refresh: 60, - entity_id: [ - 'switch.ac', - 'switch.decorative_lights' - ], - friendly_name: 'Recent Switches' + entity_id: ["switch.ac", "switch.decorative_lights"], + friendly_name: "Recent Switches", }, - last_changed: '2018-07-19T10:44:46.512351+00:00', - last_updated: '2018-07-19T10:44:46.512351+00:00' + last_changed: "2018-07-19T10:44:46.512351+00:00", + last_updated: "2018-07-19T10:44:46.512351+00:00", }, - 'scene.switch_on_and_off': { - entity_id: 'scene.switch_on_and_off', - state: 'scening', + "scene.switch_on_and_off": { + entity_id: "scene.switch_on_and_off", + state: "scening", attributes: { - entity_id: [ - 'switch.ac', - 'switch.decorative_lights' - ], - friendly_name: 'Switch on and off' + entity_id: ["switch.ac", "switch.decorative_lights"], + friendly_name: "Switch on and off", }, - last_changed: '2018-07-19T10:44:46.512674+00:00', - last_updated: '2018-07-19T10:44:46.512674+00:00', + last_changed: "2018-07-19T10:44:46.512674+00:00", + last_updated: "2018-07-19T10:44:46.512674+00:00", }, - 'scene.romantic_lights': { - entity_id: 'scene.romantic_lights', - state: 'scening', + "scene.romantic_lights": { + entity_id: "scene.romantic_lights", + state: "scening", attributes: { - entity_id: [ - 'light.bed_light', - 'light.ceiling_lights' - ], - friendly_name: 'Romantic lights' + entity_id: ["light.bed_light", "light.ceiling_lights"], + friendly_name: "Romantic lights", }, - last_changed: '2018-07-19T10:44:46.512985+00:00', - last_updated: '2018-07-19T10:44:46.512985+00:00', + last_changed: "2018-07-19T10:44:46.512985+00:00", + last_updated: "2018-07-19T10:44:46.512985+00:00", }, - 'configurator.philips_hue': { - entity_id: 'configurator.philips_hue', - state: 'configure', + "configurator.philips_hue": { + entity_id: "configurator.philips_hue", + state: "configure", attributes: { - configure_id: '4596919600-1', + configure_id: "4596919600-1", fields: [ { - id: 'username', - name: 'Username' - } + id: "username", + name: "Username", + }, ], - friendly_name: 'Philips Hue', + friendly_name: "Philips Hue", entity_picture: null, - description: 'Press the button on the bridge to register Philips Hue with Home Assistant.\n\n![Description image](/static/images/config_philips_hue.jpg)', - submit_caption: 'I have pressed the button' + description: + "Press the button on the bridge to register Philips Hue with Home Assistant.\n\n![Description image](/static/images/config_philips_hue.jpg)", + submit_caption: "I have pressed the button", }, - last_changed: '2018-07-19T10:44:46.515160+00:00', - last_updated: '2018-07-19T10:44:46.515160+00:00', - } + last_changed: "2018-07-19T10:44:46.515160+00:00", + last_updated: "2018-07-19T10:44:46.515160+00:00", + }, }; diff --git a/gallery/src/data/entity.js b/gallery/src/data/entity.js index 756354e0fa..b4e5761935 100644 --- a/gallery/src/data/entity.js +++ b/gallery/src/data/entity.js @@ -1,6 +1,6 @@ const now = () => new Date().toISOString(); const randomTime = () => - new Date(new Date().getTime() - (Math.random() * 80 * 60 * 1000)).toISOString(); + new Date(new Date().getTime() - Math.random() * 80 * 60 * 1000).toISOString(); /* eslint-disable no-unused-vars */ @@ -18,19 +18,23 @@ export class Entity { } async handleService(domain, service, data) { - console.log(`Unmocked service for ${this.entityId}: ${domain}/${service}`, data); + console.log( + `Unmocked service for ${this.entityId}: ${domain}/${service}`, + data + ); } update(state, attributes = {}) { this.state = state; this.lastUpdated = now(); - this.lastChanged = state === this.state ? this.lastChanged : this.lastUpdated; + this.lastChanged = + state === this.state ? this.lastChanged : this.lastUpdated; this.attributes = Object.assign({}, this.baseAttributes, attributes); - console.log('update', this.entityId, this); + console.log("update", this.entityId, this); this.hass.updateStates({ - [this.entityId]: this.toState() + [this.entityId]: this.toState(), }); } @@ -47,22 +51,25 @@ export class Entity { export class LightEntity extends Entity { async handleService(domain, service, data) { - if (!['homeassistant', this.domain].includes(domain)) return; + if (!["homeassistant", this.domain].includes(domain)) return; - if (service === 'turn_on') { + if (service === "turn_on") { // eslint-disable-next-line const { brightness, hs_color } = data; - this.update('on', Object.assign(this.attributes, { - brightness, - hs_color, - })); - } else if (service === 'turn_off') { - this.update('off'); - } else if (service === 'toggle') { - if (this.state === 'on') { - this.handleService(domain, 'turn_off', data); + this.update( + "on", + Object.assign(this.attributes, { + brightness, + hs_color, + }) + ); + } else if (service === "turn_off") { + this.update("off"); + } else if (service === "toggle") { + if (this.state === "on") { + this.handleService(domain, "turn_off", data); } else { - this.handleService(domain, 'turn_on', data); + this.handleService(domain, "turn_on", data); } } } @@ -72,10 +79,10 @@ export class LockEntity extends Entity { async handleService(domain, service, data) { if (domain !== this.domain) return; - if (service === 'lock') { - this.update('locked'); - } else if (service === 'unlock') { - this.update('unlocked'); + if (service === "lock") { + this.update("locked"); + } else if (service === "unlock") { + this.update("unlocked"); } } } @@ -84,24 +91,26 @@ export class CoverEntity extends Entity { async handleService(domain, service, data) { if (domain !== this.domain) return; - if (service === 'open_cover') { - this.update('open'); - } else if (service === 'close_cover') { - this.update('closing'); + if (service === "open_cover") { + this.update("open"); + } else if (service === "close_cover") { + this.update("closing"); } } } export class GroupEntity extends Entity { async handleService(domain, service, data) { - if (!['homeassistant', this.domain].includes(domain)) return; + if (!["homeassistant", this.domain].includes(domain)) return; - await Promise.all(this.attributes.entity_id.map((ent) => { - const entity = this.hass.mockEntities[ent]; - return entity.handleService(entity.domain, service, data); - })); + await Promise.all( + this.attributes.entity_id.map((ent) => { + const entity = this.hass.mockEntities[ent]; + return entity.handleService(entity.domain, service, data); + }) + ); - this.update(service === 'turn_on' ? 'on' : 'off'); + this.update(service === "turn_on" ? "on" : "off"); } } diff --git a/gallery/src/data/hass.js b/gallery/src/data/hass.js index 918132af4c..82d4a21d0a 100644 --- a/gallery/src/data/hass.js +++ b/gallery/src/data/hass.js @@ -9,16 +9,18 @@ export default class FakeHass { } async callService(domain, service, serviceData) { - console.log('callService', { domain, service, serviceData }); + console.log("callService", { domain, service, serviceData }); return Promise.resolve(); } async callWS(msg) { const callback = this._wsCommands[msg.type]; - return callback ? callback(msg) : Promise.reject({ - code: 'command_not_mocked', - message: 'This command is not implemented in the gallery.', - }); + return callback + ? callback(msg) + : Promise.reject({ + code: "command_not_mocked", + message: "This command is not implemented in the gallery.", + }); } async sendWS(msg) { @@ -29,6 +31,6 @@ export default class FakeHass { } else { console.error(`Unknown command: ${msg.type}`); } - console.log('sendWS', msg); + console.log("sendWS", msg); } } diff --git a/gallery/src/data/provide_hass.js b/gallery/src/data/provide_hass.js index 8ebadb022b..23761dcceb 100644 --- a/gallery/src/data/provide_hass.js +++ b/gallery/src/data/provide_hass.js @@ -1,9 +1,9 @@ -import fireEvent from '../../../src/common/dom/fire_event.js'; +import fireEvent from "../../../src/common/dom/fire_event.js"; -import demoConfig from './demo_config.js'; -import demoResources from './demo_resources.js'; +import demoConfig from "./demo_config.js"; +import demoResources from "./demo_resources.js"; -const ensureArray = val => (Array.isArray(val) ? val : [val]); +const ensureArray = (val) => (Array.isArray(val) ? val : [val]); export default (elements, { initialStates = {} } = {}) => { elements = ensureArray(elements); @@ -14,13 +14,15 @@ export default (elements, { initialStates = {} } = {}) => { function updateHass(obj) { hass = Object.assign({}, hass, obj); - elements.forEach((el) => { el.hass = hass; }); + elements.forEach((el) => { + el.hass = hass; + }); } updateHass({ // Home Assistant properties config: demoConfig, - language: 'en', + language: "en", resources: demoResources, states: initialStates, @@ -29,21 +31,28 @@ export default (elements, { initialStates = {} } = {}) => { // Home Assistant functions async callService(domain, service, data) { - fireEvent(elements[0], 'show-notification', { message: `Called service ${domain}/${service}` }); + fireEvent(elements[0], "show-notification", { + message: `Called service ${domain}/${service}`, + }); if (data.entity_id) { - await Promise.all(ensureArray(data.entity_id).map(ent => - entities[ent].handleService(domain, service, data))); + await Promise.all( + ensureArray(data.entity_id).map((ent) => + entities[ent].handleService(domain, service, data) + ) + ); } else { - console.log('unmocked callService', domain, service, data); + console.log("unmocked callService", domain, service, data); } }, async callWS(msg) { const callback = wsCommands[msg.type]; - return callback ? callback(msg) : Promise.reject({ - code: 'command_not_mocked', - message: 'This command is not implemented in the gallery.', - }); + return callback + ? callback(msg) + : Promise.reject({ + code: "command_not_mocked", + message: "This command is not implemented in the gallery.", + }); }, async sendWS(msg) { @@ -54,7 +63,7 @@ export default (elements, { initialStates = {} } = {}) => { } else { console.error(`Unknown command: ${msg.type}`); } - console.log('sendWS', msg); + console.log("sendWS", msg); }, // Mock functions @@ -72,7 +81,7 @@ export default (elements, { initialStates = {} } = {}) => { states[ent.entityId] = ent.toState(); }); this.updateStates(states); - } + }, }); return hass; diff --git a/gallery/src/demos/demo-hui-conditional-card.js b/gallery/src/demos/demo-hui-conditional-card.js index 69288eee08..9511be12e0 100644 --- a/gallery/src/demos/demo-hui-conditional-card.js +++ b/gallery/src/demos/demo-hui-conditional-card.js @@ -1,28 +1,28 @@ -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import getEntity from '../data/entity.js'; -import provideHass from '../data/provide_hass.js'; -import '../components/demo-cards.js'; +import getEntity from "../data/entity.js"; +import provideHass from "../data/provide_hass.js"; +import "../components/demo-cards.js"; const ENTITIES = [ - getEntity('light', 'controller_1', 'on', { - friendly_name: 'Controller 1' + getEntity("light", "controller_1", "on", { + friendly_name: "Controller 1", }), - getEntity('light', 'controller_2', 'on', { - friendly_name: 'Controller 2' + getEntity("light", "controller_2", "on", { + friendly_name: "Controller 2", }), - getEntity('light', 'floor', 'off', { - friendly_name: 'Floor light' + getEntity("light", "floor", "off", { + friendly_name: "Floor light", }), - getEntity('light', 'kitchen', 'on', { - friendly_name: 'Kitchen light' + getEntity("light", "kitchen", "on", { + friendly_name: "Kitchen light", }), ]; const CONFIGS = [ { - heading: 'Controller', + heading: "Controller", config: ` - type: entities entities: @@ -31,10 +31,10 @@ const CONFIGS = [ - type: divider - light.floor - light.kitchen - ` + `, }, { - heading: 'Demo', + heading: "Demo", config: ` - type: conditional conditions: @@ -49,7 +49,7 @@ const CONFIGS = [ - light.controller_2 - light.floor - light.kitchen - ` + `, }, ]; @@ -68,7 +68,7 @@ class DemoConditional extends PolymerElement { return { _configs: { type: Object, - value: CONFIGS + value: CONFIGS, }, hass: Object, }; @@ -81,4 +81,4 @@ class DemoConditional extends PolymerElement { } } -customElements.define('demo-hui-conditional-card', DemoConditional); +customElements.define("demo-hui-conditional-card", DemoConditional); diff --git a/gallery/src/demos/demo-hui-entities-card.js b/gallery/src/demos/demo-hui-entities-card.js index 3f7d7af134..bee6f72b50 100644 --- a/gallery/src/demos/demo-hui-entities-card.js +++ b/gallery/src/demos/demo-hui-entities-card.js @@ -1,75 +1,70 @@ -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import getEntity from '../data/entity.js'; -import provideHass from '../data/provide_hass.js'; -import '../components/demo-cards.js'; +import getEntity from "../data/entity.js"; +import provideHass from "../data/provide_hass.js"; +import "../components/demo-cards.js"; const ENTITIES = [ - getEntity('light', 'bed_light', 'on', { - friendly_name: 'Bed Light' + getEntity("light", "bed_light", "on", { + friendly_name: "Bed Light", }), - getEntity('group', 'kitchen', 'on', { - entity_id: [ - 'light.bed_light', - ], + getEntity("group", "kitchen", "on", { + entity_id: ["light.bed_light"], order: 8, - friendly_name: 'Kitchen' + friendly_name: "Kitchen", }), - getEntity('lock', 'kitchen_door', 'locked', { - friendly_name: 'Kitchen Door' + getEntity("lock", "kitchen_door", "locked", { + friendly_name: "Kitchen Door", }), - getEntity('cover', 'kitchen_window', 'open', { - friendly_name: 'Kitchen Window', - supported_features: 11 + getEntity("cover", "kitchen_window", "open", { + friendly_name: "Kitchen Window", + supported_features: 11, }), - getEntity('scene', 'romantic_lights', 'scening', { - entity_id: [ - 'light.bed_light', - 'light.ceiling_lights' - ], - friendly_name: 'Romantic lights' + getEntity("scene", "romantic_lights", "scening", { + entity_id: ["light.bed_light", "light.ceiling_lights"], + friendly_name: "Romantic lights", }), - getEntity('device_tracker', 'demo_paulus', 'home', { - source_type: 'gps', + getEntity("device_tracker", "demo_paulus", "home", { + source_type: "gps", latitude: 32.877105, longitude: 117.232185, gps_accuracy: 91, battery: 71, - friendly_name: 'Paulus' + friendly_name: "Paulus", }), - getEntity('climate', 'ecobee', 'auto', { + getEntity("climate", "ecobee", "auto", { current_temperature: 73, min_temp: 45, max_temp: 95, temperature: null, target_temp_high: 75, target_temp_low: 70, - fan_mode: 'Auto Low', - fan_list: ['On Low', 'On High', 'Auto Low', 'Auto High', 'Off'], - operation_mode: 'auto', - operation_list: ['heat', 'cool', 'auto', 'off'], - hold_mode: 'home', - swing_mode: 'Auto', - swing_list: ['Auto', '1', '2', '3', 'Off'], - unit_of_measurement: '°F', - friendly_name: 'Ecobee', - supported_features: 1014 + fan_mode: "Auto Low", + fan_list: ["On Low", "On High", "Auto Low", "Auto High", "Off"], + operation_mode: "auto", + operation_list: ["heat", "cool", "auto", "off"], + hold_mode: "home", + swing_mode: "Auto", + swing_list: ["Auto", "1", "2", "3", "Off"], + unit_of_measurement: "°F", + friendly_name: "Ecobee", + supported_features: 1014, }), - getEntity('input_number', 'noise_allowance', 5, { + getEntity("input_number", "noise_allowance", 5, { min: 0, max: 10, step: 1, - mode: 'slider', - unit_of_measurement: 'dB', - friendly_name: 'Allowed Noise', - icon: 'mdi:bell-ring' - }) + mode: "slider", + unit_of_measurement: "dB", + friendly_name: "Allowed Noise", + icon: "mdi:bell-ring", + }), ]; const CONFIGS = [ { - heading: 'Basic', + heading: "Basic", config: ` - type: entities entities: @@ -82,10 +77,10 @@ const CONFIGS = [ - light.non_existing - climate.ecobee - input_number.noise_allowance - ` + `, }, { - heading: 'With title, toggle-able', + heading: "With title, toggle-able", config: ` - type: entities entities: @@ -98,10 +93,10 @@ const CONFIGS = [ - climate.ecobee - input_number.noise_allowance title: Random group - ` + `, }, { - heading: 'With title, toggle = false', + heading: "With title, toggle = false", config: ` - type: entities entities: @@ -115,19 +110,19 @@ const CONFIGS = [ - input_number.noise_allowance title: Random group show_header_toggle: false - ` + `, }, { - heading: 'With title, can\'t toggle', + heading: "With title, can't toggle", config: ` - type: entities entities: - device_tracker.demo_paulus title: Random group - ` + `, }, { - heading: 'Custom name, secondary info, custom icon', + heading: "Custom name, secondary info, custom icon", config: ` - type: entities entities: @@ -147,10 +142,10 @@ const CONFIGS = [ - input_number.noise_allowance title: Random group show_header_toggle: false - ` + `, }, { - heading: 'Special rows', + heading: "Special rows", config: ` - type: entities entities: @@ -171,7 +166,7 @@ const CONFIGS = [ height: 30px margin: 4px 0 background: center / contain url("/images/divider.png") no-repeat - ` + `, }, ]; @@ -190,7 +185,7 @@ class DemoEntities extends PolymerElement { return { _configs: { type: Object, - value: CONFIGS + value: CONFIGS, }, hass: Object, }; @@ -203,4 +198,4 @@ class DemoEntities extends PolymerElement { } } -customElements.define('demo-hui-entities-card', DemoEntities); +customElements.define("demo-hui-entities-card", DemoEntities); diff --git a/gallery/src/demos/demo-hui-entity-filter-card.js b/gallery/src/demos/demo-hui-entity-filter-card.js index 5eb831da0b..09835e19ec 100644 --- a/gallery/src/demos/demo-hui-entity-filter-card.js +++ b/gallery/src/demos/demo-hui-entity-filter-card.js @@ -1,11 +1,11 @@ -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import '../components/demo-cards.js'; +import "../components/demo-cards.js"; const CONFIGS = [ { - heading: 'Basic', + heading: "Basic", config: ` - type: entity-filter entities: @@ -18,10 +18,10 @@ const CONFIGS = [ state_filter: - "on" - not_home - ` + `, }, { - heading: 'With card config', + heading: "With card config", config: ` - type: entity-filter entities: @@ -37,10 +37,10 @@ const CONFIGS = [ card: type: glance show_state: false - ` + `, }, { - heading: 'Showing single entity conditionally', + heading: "Showing single entity conditionally", config: ` - type: entity-filter entities: @@ -50,8 +50,8 @@ const CONFIGS = [ card: type: media-control entity: media_player.lounge_room - ` - } + `, + }, ]; class DemoFilter extends PolymerElement { @@ -65,10 +65,10 @@ class DemoFilter extends PolymerElement { return { _configs: { type: Object, - value: CONFIGS - } + value: CONFIGS, + }, }; } } -customElements.define('demo-hui-entity-filter-card', DemoFilter); +customElements.define("demo-hui-entity-filter-card", DemoFilter); diff --git a/gallery/src/demos/demo-hui-gauge-card.js b/gallery/src/demos/demo-hui-gauge-card.js index 20d37bf5d0..f737c4fd02 100644 --- a/gallery/src/demos/demo-hui-gauge-card.js +++ b/gallery/src/demos/demo-hui-gauge-card.js @@ -1,34 +1,34 @@ -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import '../components/demo-cards.js'; +import "../components/demo-cards.js"; const CONFIGS = [ { - heading: 'Basic example', + heading: "Basic example", config: ` - type: gauge entity: sensor.brightness - ` + `, }, { - heading: 'With title', + heading: "With title", config: ` - type: gauge title: Humidity entity: sensor.outside_humidity - ` + `, }, { - heading: 'Custom Unit of Measurement', + heading: "Custom Unit of Measurement", config: ` - type: gauge entity: sensor.outside_temperature unit_of_measurement: C - ` + `, }, { - heading: 'Setting Severity Levels', + heading: "Setting Severity Levels", config: ` - type: gauge entity: sensor.brightness @@ -36,30 +36,30 @@ const CONFIGS = [ red: 32 green: 0 yellow: 23 - ` + `, }, { - heading: 'Setting Min and Max Values', + heading: "Setting Min and Max Values", config: ` - type: gauge entity: sensor.brightness min: 0 max: 38 - ` + `, }, { - heading: 'Invalid Entity', + heading: "Invalid Entity", config: ` - type: gauge entity: sensor.invalid_entity - ` + `, }, { - heading: 'Non-Numeric Value', + heading: "Non-Numeric Value", config: ` - type: gauge entity: plant.bonsai - ` + `, }, ]; @@ -74,10 +74,10 @@ class DemoGaugeEntity extends PolymerElement { return { _configs: { type: Object, - value: CONFIGS - } + value: CONFIGS, + }, }; } } -customElements.define('demo-hui-gauge-card', DemoGaugeEntity); +customElements.define("demo-hui-gauge-card", DemoGaugeEntity); diff --git a/gallery/src/demos/demo-hui-glance-card.js b/gallery/src/demos/demo-hui-glance-card.js index d80319b762..86c92e450b 100644 --- a/gallery/src/demos/demo-hui-glance-card.js +++ b/gallery/src/demos/demo-hui-glance-card.js @@ -1,11 +1,11 @@ -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import '../components/demo-cards.js'; +import "../components/demo-cards.js"; const CONFIGS = [ { - heading: 'Basic example', + heading: "Basic example", config: ` - type: glance entities: @@ -16,10 +16,10 @@ const CONFIGS = [ - light.kitchen_lights - lock.kitchen_door - light.ceiling_lights - ` + `, }, { - heading: 'With title', + heading: "With title", config: ` - type: glance title: This is glance @@ -31,10 +31,10 @@ const CONFIGS = [ - light.kitchen_lights - lock.kitchen_door - light.ceiling_lights - ` + `, }, { - heading: 'Custom column width', + heading: "Custom column width", config: ` - type: glance column_width: calc(100% / 7) @@ -46,10 +46,10 @@ const CONFIGS = [ - light.kitchen_lights - lock.kitchen_door - light.ceiling_lights - ` + `, }, { - heading: 'No name', + heading: "No name", config: ` - type: glance show_name: false @@ -61,10 +61,10 @@ const CONFIGS = [ - light.kitchen_lights - lock.kitchen_door - light.ceiling_lights - ` + `, }, { - heading: 'No state', + heading: "No state", config: ` - type: glance show_state: false @@ -76,10 +76,10 @@ const CONFIGS = [ - light.kitchen_lights - lock.kitchen_door - light.ceiling_lights - ` + `, }, { - heading: 'No name and no state', + heading: "No name and no state", config: ` - type: glance show_name: false @@ -92,10 +92,10 @@ const CONFIGS = [ - light.kitchen_lights - lock.kitchen_door - light.ceiling_lights - ` + `, }, { - heading: 'Custom name, custom icon', + heading: "Custom name, custom icon", config: ` - type: glance entities: @@ -109,10 +109,10 @@ const CONFIGS = [ icon: mdi:alarm-light - lock.kitchen_door - light.ceiling_lights - ` + `, }, { - heading: 'Custom tap action', + heading: "Custom tap action", config: ` - type: glance entities: @@ -126,10 +126,10 @@ const CONFIGS = [ - sun.sun - cover.kitchen_window - light.kitchen_lights - ` + `, }, { - heading: 'Selectively hidden name', + heading: "Selectively hidden name", config: ` - type: glance entities: @@ -140,10 +140,10 @@ const CONFIGS = [ - entity: cover.kitchen_window name: - light.kitchen_lights - ` + `, }, { - heading: 'Primary theme', + heading: "Primary theme", config: ` - type: glance theming: primary @@ -155,7 +155,7 @@ const CONFIGS = [ - light.kitchen_lights - lock.kitchen_door - light.ceiling_lights - ` + `, }, ]; @@ -170,10 +170,10 @@ class DemoPicEntity extends PolymerElement { return { _configs: { type: Object, - value: CONFIGS - } + value: CONFIGS, + }, }; } } -customElements.define('demo-hui-glance-card', DemoPicEntity); +customElements.define("demo-hui-glance-card", DemoPicEntity); diff --git a/gallery/src/demos/demo-hui-iframe-card.js b/gallery/src/demos/demo-hui-iframe-card.js index e6799470ea..c705916d5d 100644 --- a/gallery/src/demos/demo-hui-iframe-card.js +++ b/gallery/src/demos/demo-hui-iframe-card.js @@ -1,39 +1,39 @@ -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import '../components/demo-cards.js'; +import "../components/demo-cards.js"; const CONFIGS = [ { - heading: 'Without title', + heading: "Without title", config: ` - type: iframe url: https://embed.windy.com/embed2.html - ` + `, }, { - heading: 'With title', + heading: "With title", config: ` - type: iframe url: https://embed.windy.com/embed2.html title: Weather radar - ` + `, }, { - heading: 'Height-Width 3:4', + heading: "Height-Width 3:4", config: ` - type: iframe url: https://embed.windy.com/embed2.html aspect_ratio: 75% - ` + `, }, { - heading: 'Height-Width 1:1', + heading: "Height-Width 1:1", config: ` - type: iframe url: https://embed.windy.com/embed2.html aspect_ratio: 100% - ` + `, }, ]; @@ -48,10 +48,10 @@ class DemoIframe extends PolymerElement { return { _configs: { type: Object, - value: CONFIGS - } + value: CONFIGS, + }, }; } } -customElements.define('demo-hui-iframe-card', DemoIframe); +customElements.define("demo-hui-iframe-card", DemoIframe); diff --git a/gallery/src/demos/demo-hui-map-card.js b/gallery/src/demos/demo-hui-map-card.js index ee3050e0d5..ed5426a2e2 100644 --- a/gallery/src/demos/demo-hui-map-card.js +++ b/gallery/src/demos/demo-hui-map-card.js @@ -1,120 +1,120 @@ -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import getEntity from '../data/entity.js'; -import provideHass from '../data/provide_hass.js'; -import '../components/demo-cards.js'; +import getEntity from "../data/entity.js"; +import provideHass from "../data/provide_hass.js"; +import "../components/demo-cards.js"; const ENTITIES = [ - getEntity('device_tracker', 'demo_paulus', 'not_home', { - source_type: 'gps', + getEntity("device_tracker", "demo_paulus", "not_home", { + source_type: "gps", latitude: 32.877105, longitude: 117.232185, gps_accuracy: 91, battery: 71, - friendly_name: 'Paulus' + friendly_name: "Paulus", }), - getEntity('device_tracker', 'demo_home_boy', 'home', { - source_type: 'gps', + getEntity("device_tracker", "demo_home_boy", "home", { + source_type: "gps", latitude: 32.87334, longitude: 117.22745, gps_accuracy: 20, battery: 53, - friendly_name: 'Home Boy' + friendly_name: "Home Boy", }), - getEntity('zone', 'home', 'zoning', { + getEntity("zone", "home", "zoning", { latitude: 32.87354, longitude: 117.22765, radius: 100, - friendly_name: 'Home', - icon: 'mdi:home' - }) + friendly_name: "Home", + icon: "mdi:home", + }), ]; const CONFIGS = [ { - heading: 'Without title', + heading: "Without title", config: ` - type: map entities: - entity: device_tracker.demo_paulus - device_tracker.demo_home_boy - zone.home - ` + `, }, { - heading: 'With title', + heading: "With title", config: ` - type: map entities: - entity: device_tracker.demo_paulus - zone.home title: Where is Paulus? - ` + `, }, { - heading: 'Height-Width 1:2', + heading: "Height-Width 1:2", config: ` - type: map entities: - entity: device_tracker.demo_paulus - zone.home aspect_ratio: 50% - ` + `, }, { - heading: 'Default Zoom', + heading: "Default Zoom", config: ` - type: map default_zoom: 12 entities: - entity: device_tracker.demo_paulus - zone.home - ` + `, }, { - heading: 'Default Zoom too High', + heading: "Default Zoom too High", config: ` - type: map default_zoom: 20 entities: - entity: device_tracker.demo_paulus - zone.home - ` + `, }, { - heading: 'Single Marker', + heading: "Single Marker", config: ` - type: map entities: - device_tracker.demo_paulus - ` + `, }, { - heading: 'Single Marker Default Zoom', + heading: "Single Marker Default Zoom", config: ` - type: map default_zoom: 8 entities: - device_tracker.demo_paulus - ` + `, }, { - heading: 'No Entities', + heading: "No Entities", config: ` - type: map entities: - light.bed_light - ` + `, }, { - heading: 'No Entities, Default Zoom', + heading: "No Entities, Default Zoom", config: ` - type: map default_zoom: 8 entities: - light.bed_light - ` + `, }, ]; @@ -133,9 +133,9 @@ class DemoMap extends PolymerElement { return { _configs: { type: Object, - value: CONFIGS + value: CONFIGS, }, - hass: Object + hass: Object, }; } @@ -146,4 +146,4 @@ class DemoMap extends PolymerElement { } } -customElements.define('demo-hui-map-card', DemoMap); +customElements.define("demo-hui-map-card", DemoMap); diff --git a/gallery/src/demos/demo-hui-markdown-card.js b/gallery/src/demos/demo-hui-markdown-card.js index 8d2eb15ca7..b8bbc72582 100644 --- a/gallery/src/demos/demo-hui-markdown-card.js +++ b/gallery/src/demos/demo-hui-markdown-card.js @@ -1,11 +1,11 @@ -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import '../components/demo-cards.js'; +import "../components/demo-cards.js"; const CONFIGS = [ { - heading: 'markdown-it demo', + heading: "markdown-it demo", config: ` - type: markdown content: > @@ -248,7 +248,7 @@ const CONFIGS = [ ::: warning *here be dragons* ::: - ` + `, }, ]; @@ -263,10 +263,10 @@ class DemoMarkdown extends PolymerElement { return { _configs: { type: Object, - value: CONFIGS - } + value: CONFIGS, + }, }; } } -customElements.define('demo-hui-markdown-card', DemoMarkdown); +customElements.define("demo-hui-markdown-card", DemoMarkdown); diff --git a/gallery/src/demos/demo-hui-media-player-rows.js b/gallery/src/demos/demo-hui-media-player-rows.js index 04f3850721..fb2f5020dd 100644 --- a/gallery/src/demos/demo-hui-media-player-rows.js +++ b/gallery/src/demos/demo-hui-media-player-rows.js @@ -1,58 +1,58 @@ -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import getEntity from '../data/entity.js'; -import provideHass from '../data/provide_hass.js'; -import '../components/demo-cards.js'; +import getEntity from "../data/entity.js"; +import provideHass from "../data/provide_hass.js"; +import "../components/demo-cards.js"; const ENTITIES = [ - getEntity('media_player', 'bedroom', 'playing', { - media_content_type: 'movie', - media_title: 'Epic sax guy 10 hours', - app_name: 'YouTube', - supported_features: 32 + getEntity("media_player", "bedroom", "playing", { + media_content_type: "movie", + media_title: "Epic sax guy 10 hours", + app_name: "YouTube", + supported_features: 32, }), - getEntity('media_player', 'family_room', 'paused', { - media_content_type: 'music', - media_title: 'I Wanna Be A Hippy (Flamman & Abraxas Radio Mix)', - media_artist: 'Technohead', - supported_features: 16417 + getEntity("media_player", "family_room", "paused", { + media_content_type: "music", + media_title: "I Wanna Be A Hippy (Flamman & Abraxas Radio Mix)", + media_artist: "Technohead", + supported_features: 16417, }), - getEntity('media_player', 'family_room_no_play', 'paused', { - media_content_type: 'movie', - media_title: 'Epic sax guy 10 hours', - app_name: 'YouTube', - supported_features: 33 + getEntity("media_player", "family_room_no_play", "paused", { + media_content_type: "movie", + media_title: "Epic sax guy 10 hours", + app_name: "YouTube", + supported_features: 33, }), - getEntity('media_player', 'living_room', 'playing', { - media_content_type: 'tvshow', - media_title: 'Chapter 1', - media_series_title: 'House of Cards', - app_name: 'Netflix', - supported_features: 1 - }), - getEntity('media_player', 'lounge_room', 'idle', { - media_content_type: 'music', - media_title: 'I Wanna Be A Hippy (Flamman & Abraxas Radio Mix)', - media_artist: 'Technohead', + getEntity("media_player", "living_room", "playing", { + media_content_type: "tvshow", + media_title: "Chapter 1", + media_series_title: "House of Cards", + app_name: "Netflix", supported_features: 1, }), - getEntity('media_player', 'theater', 'off', { - media_content_type: 'movie', - media_title: 'Epic sax guy 10 hours', - app_name: 'YouTube', - supported_features: 33 + getEntity("media_player", "lounge_room", "idle", { + media_content_type: "music", + media_title: "I Wanna Be A Hippy (Flamman & Abraxas Radio Mix)", + media_artist: "Technohead", + supported_features: 1, }), - getEntity('media_player', 'android_cast', 'playing', { - media_title: 'Android Screen Casting', - app_name: 'Screen Mirroring', - supported_features: 21437 + getEntity("media_player", "theater", "off", { + media_content_type: "movie", + media_title: "Epic sax guy 10 hours", + app_name: "YouTube", + supported_features: 33, + }), + getEntity("media_player", "android_cast", "playing", { + media_title: "Android Screen Casting", + app_name: "Screen Mirroring", + supported_features: 21437, }), ]; const CONFIGS = [ { - heading: 'Media Players', + heading: "Media Players", config: ` - type: entities entities: @@ -70,8 +70,8 @@ const CONFIGS = [ name: Chromcast Idle - entity: media_player.theater name: 'Player Off' - ` - } + `, + }, ]; class DemoHuiMediaPlayerRows extends PolymerElement { @@ -89,7 +89,7 @@ class DemoHuiMediaPlayerRows extends PolymerElement { return { _configs: { type: Object, - value: CONFIGS + value: CONFIGS, }, hass: Object, }; @@ -102,4 +102,4 @@ class DemoHuiMediaPlayerRows extends PolymerElement { } } -customElements.define('demo-hui-media-player-rows', DemoHuiMediaPlayerRows); +customElements.define("demo-hui-media-player-rows", DemoHuiMediaPlayerRows); diff --git a/gallery/src/demos/demo-hui-picture-elements-card.js b/gallery/src/demos/demo-hui-picture-elements-card.js index 46d8e25cdf..20b0fb60a5 100644 --- a/gallery/src/demos/demo-hui-picture-elements-card.js +++ b/gallery/src/demos/demo-hui-picture-elements-card.js @@ -1,11 +1,11 @@ -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import '../components/demo-cards.js'; +import "../components/demo-cards.js"; const CONFIGS = [ { - heading: 'Card with few elements', + heading: "Card with few elements", config: ` - type: picture-elements image: /images/floorplan.png @@ -49,7 +49,7 @@ const CONFIGS = [ style: top: 8% left: 35% - ` + `, }, ]; @@ -64,10 +64,10 @@ class DemoPicElements extends PolymerElement { return { _configs: { type: Object, - value: CONFIGS - } + value: CONFIGS, + }, }; } } -customElements.define('demo-hui-picture-elements-card', DemoPicElements); +customElements.define("demo-hui-picture-elements-card", DemoPicElements); diff --git a/gallery/src/demos/demo-hui-picture-entity-card.js b/gallery/src/demos/demo-hui-picture-entity-card.js index 62fbf6017c..7a5ef9b0e4 100644 --- a/gallery/src/demos/demo-hui-picture-entity-card.js +++ b/gallery/src/demos/demo-hui-picture-entity-card.js @@ -1,67 +1,67 @@ -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import '../components/demo-cards.js'; +import "../components/demo-cards.js"; const CONFIGS = [ { - heading: 'State on', + heading: "State on", config: ` - type: picture-entity image: /images/kitchen.png entity: light.kitchen_lights - ` + `, }, { - heading: 'State off', + heading: "State off", config: ` - type: picture-entity image: /images/bed.png entity: light.bed_light - ` + `, }, { - heading: 'Entity unavailable', + heading: "Entity unavailable", config: ` - type: picture-entity image: /images/living_room.png entity: light.non_existing - ` + `, }, { - heading: 'Camera entity', + heading: "Camera entity", config: ` - type: picture-entity entity: camera.demo_camera - ` + `, }, { - heading: 'Hidden name', + heading: "Hidden name", config: ` - type: picture-entity image: /images/kitchen.png entity: light.kitchen_lights show_name: false - ` + `, }, { - heading: 'Hidden state', + heading: "Hidden state", config: ` - type: picture-entity image: /images/kitchen.png entity: light.kitchen_lights show_state: false - ` + `, }, { - heading: 'Both hidden', + heading: "Both hidden", config: ` - type: picture-entity image: /images/kitchen.png entity: light.kitchen_lights show_name: false show_state: false - ` + `, }, ]; @@ -76,10 +76,10 @@ class DemoPicEntity extends PolymerElement { return { _configs: { type: Object, - value: CONFIGS - } + value: CONFIGS, + }, }; } } -customElements.define('demo-hui-picture-entity-card', DemoPicEntity); +customElements.define("demo-hui-picture-entity-card", DemoPicEntity); diff --git a/gallery/src/demos/demo-hui-picture-glance-card.js b/gallery/src/demos/demo-hui-picture-glance-card.js index aacca55c63..d78275ed2c 100644 --- a/gallery/src/demos/demo-hui-picture-glance-card.js +++ b/gallery/src/demos/demo-hui-picture-glance-card.js @@ -1,11 +1,11 @@ -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import '../components/demo-cards.js'; +import "../components/demo-cards.js"; const CONFIGS = [ { - heading: 'Title, dialog, toggle', + heading: "Title, dialog, toggle", config: ` - type: picture-glance image: /images/living_room.png @@ -15,10 +15,10 @@ const CONFIGS = [ - light.ceiling_lights - binary_sensor.movement_backyard - binary_sensor.basement_floor_wet - ` + `, }, { - heading: 'Title, dialog, no toggle', + heading: "Title, dialog, no toggle", config: ` - type: picture-glance image: /images/living_room.png @@ -26,10 +26,10 @@ const CONFIGS = [ entities: - binary_sensor.movement_backyard - binary_sensor.basement_floor_wet - ` + `, }, { - heading: 'Title, no dialog, toggle', + heading: "Title, no dialog, toggle", config: ` - type: picture-glance image: /images/living_room.png @@ -37,10 +37,10 @@ const CONFIGS = [ entities: - switch.decorative_lights - light.ceiling_lights - ` + `, }, { - heading: 'No title, dialog, toggle', + heading: "No title, dialog, toggle", config: ` - type: picture-glance image: /images/living_room.png @@ -49,30 +49,30 @@ const CONFIGS = [ - light.ceiling_lights - binary_sensor.movement_backyard - binary_sensor.basement_floor_wet - ` + `, }, { - heading: 'No title, dialog, no toggle', + heading: "No title, dialog, no toggle", config: ` - type: picture-glance image: /images/living_room.png entities: - binary_sensor.movement_backyard - binary_sensor.basement_floor_wet - ` + `, }, { - heading: 'No title, no dialog, toggle', + heading: "No title, no dialog, toggle", config: ` - type: picture-glance image: /images/living_room.png entities: - switch.decorative_lights - light.ceiling_lights - ` + `, }, { - heading: 'Custom icon', + heading: "Custom icon", config: ` - type: picture-glance image: /images/living_room.png @@ -81,7 +81,7 @@ const CONFIGS = [ - entity: switch.decorative_lights icon: mdi:power - binary_sensor.basement_floor_wet - ` + `, }, ]; @@ -96,10 +96,10 @@ class DemoPicGlance extends PolymerElement { return { _configs: { type: Object, - value: CONFIGS - } + value: CONFIGS, + }, }; } } -customElements.define('demo-hui-picture-glance-card', DemoPicGlance); +customElements.define("demo-hui-picture-glance-card", DemoPicGlance); diff --git a/gallery/src/demos/demo-hui-stack-card.js b/gallery/src/demos/demo-hui-stack-card.js index b282993dac..3a83a62d53 100644 --- a/gallery/src/demos/demo-hui-stack-card.js +++ b/gallery/src/demos/demo-hui-stack-card.js @@ -1,11 +1,11 @@ -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import '../components/demo-cards.js'; +import "../components/demo-cards.js"; const CONFIGS = [ { - heading: 'Vertical Stack', + heading: "Vertical Stack", config: ` - type: vertical-stack cards: @@ -17,10 +17,10 @@ const CONFIGS = [ - device_tracker.demo_anne_therese - device_tracker.demo_home_boy - device_tracker.demo_paulus - ` + `, }, { - heading: 'Horizontal Stack', + heading: "Horizontal Stack", config: ` - type: horizontal-stack cards: @@ -32,10 +32,10 @@ const CONFIGS = [ - device_tracker.demo_anne_therese - device_tracker.demo_home_boy - device_tracker.demo_paulus - ` + `, }, { - heading: 'Combination of both', + heading: "Combination of both", config: ` - type: vertical-stack cards: @@ -52,7 +52,7 @@ const CONFIGS = [ - type: picture-entity image: /images/bed.png entity: light.bed_light - ` + `, }, ]; @@ -67,10 +67,10 @@ class DemoStack extends PolymerElement { return { _configs: { type: Object, - value: CONFIGS - } + value: CONFIGS, + }, }; } } -customElements.define('demo-hui-stack-card', DemoStack); +customElements.define("demo-hui-stack-card", DemoStack); diff --git a/gallery/src/demos/demo-more-info-light.js b/gallery/src/demos/demo-more-info-light.js index 896e4e7512..601e731957 100644 --- a/gallery/src/demos/demo-more-info-light.js +++ b/gallery/src/demos/demo-more-info-light.js @@ -1,13 +1,13 @@ -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import '../../../src/dialogs/more-info/controls/more-info-content.js'; -import '../../../src/components/ha-card.js'; +import "../../../src/dialogs/more-info/controls/more-info-content.js"; +import "../../../src/components/ha-card.js"; -import getEntity from '../data/entity.js'; -import provideHass from '../data/provide_hass.js'; +import getEntity from "../data/entity.js"; +import provideHass from "../data/provide_hass.js"; -import '../components/demo-more-infos.js'; +import "../components/demo-more-infos.js"; /* eslint-disable no-unused-vars */ @@ -20,17 +20,16 @@ const SUPPORT_TRANSITION = 32; const SUPPORT_WHITE_VALUE = 128; const ENTITIES = [ - getEntity('light', 'bed_light', 'on', { - friendly_name: 'Basic Light' + getEntity("light", "bed_light", "on", { + friendly_name: "Basic Light", }), - getEntity('light', 'kitchen_light', 'on', { - friendly_name: 'Brightness Light', + getEntity("light", "kitchen_light", "on", { + friendly_name: "Brightness Light", brightness: 80, supported_features: SUPPORT_BRIGHTNESS, }), ]; - class DemoMoreInfoLight extends PolymerElement { static get template() { return html` @@ -45,7 +44,7 @@ class DemoMoreInfoLight extends PolymerElement { return { _entities: { type: Array, - value: ENTITIES.map(ent => ent.entityId), + value: ENTITIES.map((ent) => ent.entityId), }, }; } @@ -57,4 +56,4 @@ class DemoMoreInfoLight extends PolymerElement { } } -customElements.define('demo-more-info-light', DemoMoreInfoLight); +customElements.define("demo-more-info-light", DemoMoreInfoLight); diff --git a/gallery/src/entrypoint.js b/gallery/src/entrypoint.js index 8da68cea70..a690d9d3e0 100644 --- a/gallery/src/entrypoint.js +++ b/gallery/src/entrypoint.js @@ -1,12 +1,12 @@ -import '@polymer/paper-styles/typography.js'; -import '@polymer/polymer/lib/elements/dom-if.js'; -import '@polymer/polymer/lib/elements/dom-repeat.js'; +import "@polymer/paper-styles/typography.js"; +import "@polymer/polymer/lib/elements/dom-if.js"; +import "@polymer/polymer/lib/elements/dom-repeat.js"; -import '../../src/resources/hass-icons.js'; -import '../../src/resources/ha-style.js'; -import '../../src/resources/roboto.js'; -import '../../src/components/ha-iconset-svg.js'; +import "../../src/resources/hass-icons.js"; +import "../../src/resources/ha-style.js"; +import "../../src/resources/roboto.js"; +import "../../src/components/ha-iconset-svg.js"; -import './ha-gallery.js'; +import "./ha-gallery.js"; -document.body.appendChild(document.createElement('ha-gallery')); +document.body.appendChild(document.createElement("ha-gallery")); diff --git a/gallery/src/ha-gallery.js b/gallery/src/ha-gallery.js index bd11618260..c9d6818099 100644 --- a/gallery/src/ha-gallery.js +++ b/gallery/src/ha-gallery.js @@ -1,19 +1,19 @@ -import '@polymer/app-layout/app-header-layout/app-header-layout.js'; -import '@polymer/app-layout/app-header/app-header.js'; -import '@polymer/app-layout/app-toolbar/app-toolbar.js'; -import '@polymer/iron-icon/iron-icon.js'; -import '@polymer/paper-card/paper-card.js'; -import '@polymer/paper-item/paper-item.js'; -import '@polymer/paper-item/paper-item-body.js'; -import '@polymer/paper-icon-button/paper-icon-button.js'; -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import "@polymer/app-layout/app-header-layout/app-header-layout.js"; +import "@polymer/app-layout/app-header/app-header.js"; +import "@polymer/app-layout/app-toolbar/app-toolbar.js"; +import "@polymer/iron-icon/iron-icon.js"; +import "@polymer/paper-card/paper-card.js"; +import "@polymer/paper-item/paper-item.js"; +import "@polymer/paper-item/paper-item-body.js"; +import "@polymer/paper-icon-button/paper-icon-button.js"; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import '../../src/managers/notification-manager.js'; +import "../../src/managers/notification-manager.js"; -const DEMOS = require.context('./demos', true, /^(.*\.(js$))[^.]*$/im); +const DEMOS = require.context("./demos", true, /^(.*\.(js$))[^.]*$/im); -const fixPath = path => path.substr(2, path.length - 5); +const fixPath = (path) => path.substr(2, path.length - 5); class HaGallery extends PolymerElement { static get template() { @@ -131,19 +131,19 @@ class HaGallery extends PolymerElement { _demo: { type: String, value: document.location.hash.substr(1), - observer: '_demoChanged', + observer: "_demoChanged", }, _demos: { type: Array, - value: DEMOS.keys().map(fixPath) + value: DEMOS.keys().map(fixPath), }, _lovelaceDemos: { type: Array, - computed: '_computeLovelace(_demos)', + computed: "_computeLovelace(_demos)", }, _moreInfoDemos: { type: Array, - computed: '_computeMoreInfos(_demos)', + computed: "_computeMoreInfos(_demos)", }, }; } @@ -151,18 +151,21 @@ class HaGallery extends PolymerElement { ready() { super.ready(); - this.addEventListener( - 'show-notification', - ev => this.$.notifications.showNotification(ev.detail.message) + this.addEventListener("show-notification", (ev) => + this.$.notifications.showNotification(ev.detail.message) ); - this.addEventListener('hass-more-info', (ev) => { + this.addEventListener("hass-more-info", (ev) => { if (ev.detail.entityId) { - this.$.notifications.showNotification(`Showing more info for ${ev.detail.entityId}`); + this.$.notifications.showNotification( + `Showing more info for ${ev.detail.entityId}` + ); } }); - window.addEventListener('hashchange', () => { this._demo = document.location.hash.substr(1); }); + window.addEventListener("hashchange", () => { + this._demo = document.location.hash.substr(1); + }); } _withDefault(value, def) { @@ -182,20 +185,20 @@ class HaGallery extends PolymerElement { } _computeHeaderButtonClass(demo) { - return demo ? '' : 'invisible'; + return demo ? "" : "invisible"; } _backTapped() { - document.location.hash = ''; + document.location.hash = ""; } _computeLovelace(demos) { - return demos.filter(demo => demo.includes('hui')); + return demos.filter((demo) => demo.includes("hui")); } _computeMoreInfos(demos) { - return demos.filter(demo => demo.includes('more-info')); + return demos.filter((demo) => demo.includes("more-info")); } } -customElements.define('ha-gallery', HaGallery); +customElements.define("ha-gallery", HaGallery); diff --git a/gallery/webpack.config.js b/gallery/webpack.config.js index 31ced8cfcb..95498253c4 100644 --- a/gallery/webpack.config.js +++ b/gallery/webpack.config.js @@ -1,36 +1,34 @@ -const path = require('path'); -const UglifyJsPlugin = require('uglifyjs-webpack-plugin'); -const CopyWebpackPlugin = require('copy-webpack-plugin'); +const path = require("path"); +const UglifyJsPlugin = require("uglifyjs-webpack-plugin"); +const CopyWebpackPlugin = require("copy-webpack-plugin"); -const isProd = process.env.NODE_ENV === 'production'; -const chunkFilename = isProd ? - 'chunk.[chunkhash].js' : '[name].chunk.js'; -const buildPath = path.resolve(__dirname, 'dist'); -const publicPath = isProd ? './' : 'http://localhost:8080/'; +const isProd = process.env.NODE_ENV === "production"; +const chunkFilename = isProd ? "chunk.[chunkhash].js" : "[name].chunk.js"; +const buildPath = path.resolve(__dirname, "dist"); +const publicPath = isProd ? "./" : "http://localhost:8080/"; module.exports = { - mode: isProd ? 'production' : 'development', + mode: isProd ? "production" : "development", // Disabled in prod while we make Home Assistant able to serve the right files. // Was source-map - devtool: isProd ? 'none' : 'inline-source-map', - entry: './src/entrypoint.js', + devtool: isProd ? "none" : "inline-source-map", + entry: "./src/entrypoint.js", module: { rules: [ { test: /\.js$/, use: { - loader: 'babel-loader', + loader: "babel-loader", options: { plugins: [ // Only support the syntax, Webpack will handle it. - 'syntax-dynamic-import', + "syntax-dynamic-import", [ - 'transform-react-jsx', + "transform-react-jsx", { - pragma: 'h' - } + pragma: "h", + }, ], - ], }, }, @@ -38,39 +36,49 @@ module.exports = { { test: /\.(html)$/, use: { - loader: 'html-loader', + loader: "html-loader", options: { exportAsEs6Default: true, - } - } + }, + }, }, - ] + ], }, plugins: [ new CopyWebpackPlugin([ - 'public', - { from: '../public', to: 'static' }, - { from: '../build-translations/output', to: 'static/translations' }, - { from: '../node_modules/leaflet/dist/leaflet.css', to: 'static/images/leaflet/' }, - { from: '../node_modules/@polymer/font-roboto-local/fonts', to: 'static/fonts' }, - { from: '../node_modules/leaflet/dist/images', to: 'static/images/leaflet/' }, + "public", + { from: "../public", to: "static" }, + { from: "../build-translations/output", to: "static/translations" }, + { + from: "../node_modules/leaflet/dist/leaflet.css", + to: "static/images/leaflet/", + }, + { + from: "../node_modules/@polymer/font-roboto-local/fonts", + to: "static/fonts", + }, + { + from: "../node_modules/leaflet/dist/images", + to: "static/images/leaflet/", + }, ]), - isProd && new UglifyJsPlugin({ - extractComments: true, - sourceMap: true, - uglifyOptions: { - // Disabling because it broke output - mangle: false, - } - }), + isProd && + new UglifyJsPlugin({ + extractComments: true, + sourceMap: true, + uglifyOptions: { + // Disabling because it broke output + mangle: false, + }, + }), ].filter(Boolean), output: { - filename: '[name].js', + filename: "[name].js", chunkFilename: chunkFilename, path: buildPath, publicPath, }, devServer: { - contentBase: './public', - } + contentBase: "./public", + }, }; diff --git a/gulp/config.js b/gulp/config.js index 185db09813..b011a04cf3 100644 --- a/gulp/config.js +++ b/gulp/config.js @@ -1,8 +1,8 @@ -var path = require('path'); +var path = require("path"); module.exports = { - polymer_dir: path.resolve(__dirname, '..'), - build_dir: path.resolve(__dirname, '../build'), - output: path.resolve(__dirname, '../hass_frontend'), - output_es5: path.resolve(__dirname, '../hass_frontend_es5'), + polymer_dir: path.resolve(__dirname, ".."), + build_dir: path.resolve(__dirname, "../build"), + output: path.resolve(__dirname, "../hass_frontend"), + output_es5: path.resolve(__dirname, "../hass_frontend_es5"), }; diff --git a/gulp/tasks/gen-icons.js b/gulp/tasks/gen-icons.js index 6d6296f7a6..5a3c458761 100644 --- a/gulp/tasks/gen-icons.js +++ b/gulp/tasks/gen-icons.js @@ -1,31 +1,34 @@ -const gulp = require('gulp'); -const path = require('path'); -const fs = require('fs'); -const config = require('../config'); +const gulp = require("gulp"); +const path = require("path"); +const fs = require("fs"); +const config = require("../config"); -const ICON_PACKAGE_PATH = path.resolve(__dirname, '../../node_modules/@mdi/svg/'); -const META_PATH = path.resolve(ICON_PACKAGE_PATH, 'meta.json'); -const ICON_PATH = path.resolve(ICON_PACKAGE_PATH, 'svg'); -const OUTPUT_DIR = path.resolve(__dirname, '../../build'); -const MDI_OUTPUT_PATH = path.resolve(OUTPUT_DIR, 'mdi.html'); -const HASS_OUTPUT_PATH = path.resolve(OUTPUT_DIR, 'hass-icons.html'); +const ICON_PACKAGE_PATH = path.resolve( + __dirname, + "../../node_modules/@mdi/svg/" +); +const META_PATH = path.resolve(ICON_PACKAGE_PATH, "meta.json"); +const ICON_PATH = path.resolve(ICON_PACKAGE_PATH, "svg"); +const OUTPUT_DIR = path.resolve(__dirname, "../../build"); +const MDI_OUTPUT_PATH = path.resolve(OUTPUT_DIR, "mdi.html"); +const HASS_OUTPUT_PATH = path.resolve(OUTPUT_DIR, "hass-icons.html"); const BUILT_IN_PANEL_ICONS = [ - 'calendar', // Calendar - 'settings', // Config - 'home-assistant', // Hass.io - 'poll-box', // History panel - 'format-list-bulleted-type', // Logbook - 'mailbox', // Mailbox - 'account-location', // Map - 'cart', // Shopping List + "calendar", // Calendar + "settings", // Config + "home-assistant", // Hass.io + "poll-box", // History panel + "format-list-bulleted-type", // Logbook + "mailbox", // Mailbox + "account-location", // Map + "cart", // Shopping List ]; // Given an icon name, load the SVG file function loadIcon(name) { const iconPath = path.resolve(ICON_PATH, `${name}.svg`); try { - return fs.readFileSync(iconPath, 'utf-8'); + return fs.readFileSync(iconPath, "utf-8"); } catch (err) { return null; } @@ -33,7 +36,7 @@ function loadIcon(name) { // Given an SVG file, convert it to an iron-iconset-svg definition function transformXMLtoPolymer(name, xml) { - const start = xml.indexOf('>${path}`; @@ -41,22 +44,26 @@ function transformXMLtoPolymer(name, xml) { // Given an iconset name and icon names, generate a polymer iconset function generateIconset(name, iconNames) { - const iconDefs = iconNames.map(name => { - const iconDef = loadIcon(name); - if (!iconDef) { - throw new Error(`Unknown icon referenced: ${name}`); - } - return transformXMLtoPolymer(name, iconDef) - }).join(''); + const iconDefs = iconNames + .map((name) => { + const iconDef = loadIcon(name); + if (!iconDef) { + throw new Error(`Unknown icon referenced: ${name}`); + } + return transformXMLtoPolymer(name, iconDef); + }) + .join(""); return `${iconDefs}`; } // Generate the full MDI iconset function genMDIIcons() { - const meta = JSON.parse(fs.readFileSync(path.resolve(ICON_PACKAGE_PATH, META_PATH), 'UTF-8')); - const iconNames = meta.map(iconInfo => iconInfo.name); + const meta = JSON.parse( + fs.readFileSync(path.resolve(ICON_PACKAGE_PATH, META_PATH), "UTF-8") + ); + const iconNames = meta.map((iconInfo) => iconInfo.name); fs.existsSync(OUTPUT_DIR) || fs.mkdirSync(OUTPUT_DIR); - fs.writeFileSync(MDI_OUTPUT_PATH, generateIconset('mdi', iconNames)); + fs.writeFileSync(MDI_OUTPUT_PATH, generateIconset("mdi", iconNames)); } // Helper function to map recursively over files in a folder and it's subfolders @@ -75,30 +82,30 @@ function mapFiles(startPath, filter, mapFunc) { // Find all icons used by the project. function findIcons(path, iconsetName) { - const iconRegex = new RegExp(`${iconsetName}:[\\w-]+`, 'g'); + const iconRegex = new RegExp(`${iconsetName}:[\\w-]+`, "g"); const icons = new Set(); function processFile(filename) { const content = fs.readFileSync(filename); let match; // eslint-disable-next-line - while (match = iconRegex.exec(content)) { + while ((match = iconRegex.exec(content))) { // strip off "hass:" and add to set icons.add(match[0].substr(iconsetName.length + 1)); } } - mapFiles(path, '.js', processFile); + mapFiles(path, ".js", processFile); return Array.from(icons); } function genHassIcons() { - const iconNames = findIcons('./src', 'hass').concat(BUILT_IN_PANEL_ICONS); + const iconNames = findIcons("./src", "hass").concat(BUILT_IN_PANEL_ICONS); fs.existsSync(OUTPUT_DIR) || fs.mkdirSync(OUTPUT_DIR); - fs.writeFileSync(HASS_OUTPUT_PATH, generateIconset('hass', iconNames)); + fs.writeFileSync(HASS_OUTPUT_PATH, generateIconset("hass", iconNames)); } -gulp.task('gen-icons-mdi', () => genMDIIcons()); -gulp.task('gen-icons-hass', () => genHassIcons()); -gulp.task('gen-icons', ['gen-icons-hass', 'gen-icons-mdi'], () => {}); +gulp.task("gen-icons-mdi", () => genMDIIcons()); +gulp.task("gen-icons-hass", () => genHassIcons()); +gulp.task("gen-icons", ["gen-icons-hass", "gen-icons-mdi"], () => {}); module.exports = { findIcons, diff --git a/gulp/tasks/translations.js b/gulp/tasks/translations.js index 108adeb38c..7baefa1568 100755 --- a/gulp/tasks/translations.js +++ b/gulp/tasks/translations.js @@ -1,40 +1,44 @@ -const path = require('path'); -const gulp = require('gulp'); -const foreach = require('gulp-foreach'); -const hash = require('gulp-hash'); -const insert = require('gulp-insert'); -const merge = require('gulp-merge-json'); -const minify = require('gulp-jsonminify'); -const rename = require('gulp-rename'); -const transform = require('gulp-json-transform'); +const path = require("path"); +const gulp = require("gulp"); +const foreach = require("gulp-foreach"); +const hash = require("gulp-hash"); +const insert = require("gulp-insert"); +const merge = require("gulp-merge-json"); +const minify = require("gulp-jsonminify"); +const rename = require("gulp-rename"); +const transform = require("gulp-json-transform"); -const inDir = 'translations'; -const workDir = 'build-translations'; -const fullDir = workDir + '/full'; -const coreDir = workDir + '/core'; -const outDir = workDir + '/output'; +const inDir = "translations"; +const workDir = "build-translations"; +const fullDir = workDir + "/full"; +const coreDir = workDir + "/core"; +const outDir = workDir + "/output"; // Panel translations which should be split from the core translations. These // should mirror the fragment definitions in polymer.json, so that we load // additional resources at equivalent points. const TRANSLATION_FRAGMENTS = [ - 'config', - 'history', - 'logbook', - 'mailbox', - 'profile', - 'shopping-list', - 'page-authorize', - 'page-onboarding', + "config", + "history", + "logbook", + "mailbox", + "profile", + "shopping-list", + "page-authorize", + "page-onboarding", ]; const tasks = []; function recursiveFlatten(prefix, data) { let output = {}; - Object.keys(data).forEach(function (key) { - if (typeof (data[key]) === 'object') { - output = Object.assign({}, output, recursiveFlatten(prefix + key + '.', data[key])); + Object.keys(data).forEach(function(key) { + if (typeof data[key] === "object") { + output = Object.assign( + {}, + output, + recursiveFlatten(prefix + key + ".", data[key]) + ); } else { output[prefix + key] = data[key]; } @@ -43,14 +47,14 @@ function recursiveFlatten(prefix, data) { } function flatten(data) { - return recursiveFlatten('', data); + return recursiveFlatten("", data); } function emptyFilter(data) { const newData = {}; Object.keys(data).forEach((key) => { if (data[key]) { - if (typeof (data[key]) === 'object') { + if (typeof data[key] === "object") { newData[key] = emptyFilter(data[key]); } else { newData[key] = data[key]; @@ -70,16 +74,18 @@ function emptyFilter(data) { * @link https://docs.lokalise.co/article/KO5SZWLLsy-key-referencing */ const re_key_reference = /\[%key:([^%]+)%\]/; -function lokalise_transform (data, original) { +function lokalise_transform(data, original) { const output = {}; Object.entries(data).forEach(([key, value]) => { if (value instanceof Object) { output[key] = lokalise_transform(value, original); } else { output[key] = value.replace(re_key_reference, (match, key) => { - const replace = key.split('::').reduce((tr, k) => tr[k], original); - if (typeof replace !== 'string') { - throw Error(`Invalid key placeholder ${key} in src/translations/en.json`); + const replace = key.split("::").reduce((tr, k) => tr[k], original); + if (typeof replace !== "string") { + throw Error( + `Invalid key placeholder ${key} in src/translations/en.json` + ); } return replace; }); @@ -97,21 +103,24 @@ function lokalise_transform (data, original) { * project is buildable immediately after merging new translation keys, since * the Lokalise update to translations/en.json will not happen immediately. */ -let taskName = 'build-master-translation'; -gulp.task(taskName, function () { - return gulp.src('src/translations/en.json') - .pipe(transform(function(data, file) { - return lokalise_transform(data, data); - })) - .pipe(rename('translationMaster.json')) +let taskName = "build-master-translation"; +gulp.task(taskName, function() { + return gulp + .src("src/translations/en.json") + .pipe( + transform(function(data, file) { + return lokalise_transform(data, data); + }) + ) + .pipe(rename("translationMaster.json")) .pipe(gulp.dest(workDir)); }); tasks.push(taskName); -taskName = 'build-merged-translations'; -gulp.task(taskName, ['build-master-translation'], function () { - return gulp.src(inDir + '/*.json') - .pipe(foreach(function(stream, file) { +taskName = "build-merged-translations"; +gulp.task(taskName, ["build-master-translation"], function() { + return gulp.src(inDir + "/*.json").pipe( + foreach(function(stream, file) { // For each language generate a merged json file. It begins with the master // translation as a failsafe for untranslated strings, and merges all parent // tags into one file for each specific subtag @@ -119,139 +128,169 @@ gulp.task(taskName, ['build-master-translation'], function () { // TODO: This is a naive interpretation of BCP47 that should be improved. // Will be OK for now as long as we don't have anything more complicated // than a base translation + region. - const tr = path.basename(file.history[0], '.json'); - const subtags = tr.split('-'); - const src = [workDir + '/translationMaster.json']; + const tr = path.basename(file.history[0], ".json"); + const subtags = tr.split("-"); + const src = [workDir + "/translationMaster.json"]; for (let i = 1; i <= subtags.length; i++) { - const lang = subtags.slice(0, i).join('-'); - src.push(inDir + '/' + lang + '.json'); + const lang = subtags.slice(0, i).join("-"); + src.push(inDir + "/" + lang + ".json"); } - return gulp.src(src) - .pipe(transform(data => emptyFilter(data))) - .pipe(merge({ - fileName: tr + '.json', - })) + return gulp + .src(src) + .pipe(transform((data) => emptyFilter(data))) + .pipe( + merge({ + fileName: tr + ".json", + }) + ) .pipe(gulp.dest(fullDir)); - })); + }) + ); }); tasks.push(taskName); const splitTasks = []; TRANSLATION_FRAGMENTS.forEach((fragment) => { - taskName = 'build-translation-fragment-' + fragment; - gulp.task(taskName, ['build-merged-translations'], function () { + taskName = "build-translation-fragment-" + fragment; + gulp.task(taskName, ["build-merged-translations"], function() { // Return only the translations for this fragment. - return gulp.src(fullDir + '/*.json') - .pipe(transform(data => ({ - ui: { - panel: { - [fragment]: data.ui.panel[fragment], + return gulp + .src(fullDir + "/*.json") + .pipe( + transform((data) => ({ + ui: { + panel: { + [fragment]: data.ui.panel[fragment], + }, }, - }, - }))) - .pipe(gulp.dest(workDir + '/' + fragment)); + })) + ) + .pipe(gulp.dest(workDir + "/" + fragment)); }); tasks.push(taskName); splitTasks.push(taskName); }); -taskName = 'build-translation-core'; -gulp.task(taskName, ['build-merged-translations'], function () { +taskName = "build-translation-core"; +gulp.task(taskName, ["build-merged-translations"], function() { // Remove the fragment translations from the core translation. - return gulp.src(fullDir + '/*.json') - .pipe(transform((data) => { - TRANSLATION_FRAGMENTS.forEach((fragment) => { - delete data.ui.panel[fragment]; - }); - return data; - })) + return gulp + .src(fullDir + "/*.json") + .pipe( + transform((data) => { + TRANSLATION_FRAGMENTS.forEach((fragment) => { + delete data.ui.panel[fragment]; + }); + return data; + }) + ) .pipe(gulp.dest(coreDir)); }); tasks.push(taskName); splitTasks.push(taskName); -taskName = 'build-flattened-translations'; -gulp.task(taskName, splitTasks, function () { +taskName = "build-flattened-translations"; +gulp.task(taskName, splitTasks, function() { // Flatten the split versions of our translations, and move them into outDir - return gulp.src( - TRANSLATION_FRAGMENTS.map(fragment => workDir + '/' + fragment + '/*.json') - .concat(coreDir + '/*.json'), - { base: workDir }, - ) - .pipe(transform(function (data) { - // Polymer.AppLocalizeBehavior requires flattened json - return flatten(data); - })) + return gulp + .src( + TRANSLATION_FRAGMENTS.map( + (fragment) => workDir + "/" + fragment + "/*.json" + ).concat(coreDir + "/*.json"), + { base: workDir } + ) + .pipe( + transform(function(data) { + // Polymer.AppLocalizeBehavior requires flattened json + return flatten(data); + }) + ) .pipe(minify()) - .pipe(rename((filePath) => { - if (filePath.dirname === 'core') { - filePath.dirname = ''; - } - })) + .pipe( + rename((filePath) => { + if (filePath.dirname === "core") { + filePath.dirname = ""; + } + }) + ) .pipe(gulp.dest(outDir)); }); tasks.push(taskName); -taskName = 'build-translation-fingerprints'; -gulp.task(taskName, ['build-flattened-translations'], function () { - return gulp.src(outDir + '/**/*.json') - .pipe(rename({ - extname: '', - })) - .pipe(hash({ - algorithm: 'md5', - hashLength: 32, - template: '<%= name %>-<%= hash %>.json', - })) - .pipe(hash.manifest('translationFingerprints.json')) - .pipe(transform(function (data) { - // After generating fingerprints of our translation files, consolidate - // all translation fragment fingerprints under the translation name key - const newData = {}; - Object.entries(data).forEach(([key, value]) => { - const parts = key.split('/'); - let translation = key; - if (parts.length === 2) { - translation = parts[1]; - } - if (!(translation in newData)) { - newData[translation] = { - fingerprints: {}, - }; - } - newData[translation].fingerprints[key] = value; - }); - return newData; - })) +taskName = "build-translation-fingerprints"; +gulp.task(taskName, ["build-flattened-translations"], function() { + return gulp + .src(outDir + "/**/*.json") + .pipe( + rename({ + extname: "", + }) + ) + .pipe( + hash({ + algorithm: "md5", + hashLength: 32, + template: "<%= name %>-<%= hash %>.json", + }) + ) + .pipe(hash.manifest("translationFingerprints.json")) + .pipe( + transform(function(data) { + // After generating fingerprints of our translation files, consolidate + // all translation fragment fingerprints under the translation name key + const newData = {}; + Object.entries(data).forEach(([key, value]) => { + const parts = key.split("/"); + let translation = key; + if (parts.length === 2) { + translation = parts[1]; + } + if (!(translation in newData)) { + newData[translation] = { + fingerprints: {}, + }; + } + newData[translation].fingerprints[key] = value; + }); + return newData; + }) + ) .pipe(gulp.dest(workDir)); }); tasks.push(taskName); -taskName = 'build-translations'; -gulp.task(taskName, ['build-translation-fingerprints'], function () { - return gulp.src([ - 'src/translations/translationMetadata.json', - workDir + '/translationFingerprints.json', - ]) +taskName = "build-translations"; +gulp.task(taskName, ["build-translation-fingerprints"], function() { + return gulp + .src([ + "src/translations/translationMetadata.json", + workDir + "/translationFingerprints.json", + ]) .pipe(merge({})) - .pipe(transform(function (data) { - const newData = {}; - Object.entries(data).forEach(([key, value]) => { - // Filter out translations without native name. - if (data[key].nativeName) { - newData[key] = data[key]; - } else { - console.warn(`Skipping language ${key}. Native name was not translated.`); - } - if (data[key]) newData[key] = value; - }); - return newData; - })) - .pipe(transform(data => ({ - fragments: TRANSLATION_FRAGMENTS, - translations: data, - }))) - .pipe(rename('translationMetadata.json')) + .pipe( + transform(function(data) { + const newData = {}; + Object.entries(data).forEach(([key, value]) => { + // Filter out translations without native name. + if (data[key].nativeName) { + newData[key] = data[key]; + } else { + console.warn( + `Skipping language ${key}. Native name was not translated.` + ); + } + if (data[key]) newData[key] = value; + }); + return newData; + }) + ) + .pipe( + transform((data) => ({ + fragments: TRANSLATION_FRAGMENTS, + translations: data, + })) + ) + .pipe(rename("translationMetadata.json")) .pipe(gulp.dest(workDir)); }); tasks.push(taskName); diff --git a/hassio/config.js b/hassio/config.js index 4b2432c081..6edf9bb646 100644 --- a/hassio/config.js +++ b/hassio/config.js @@ -1,8 +1,8 @@ -const path = require('path'); +const path = require("path"); module.exports = { // Target directory for the build. - buildDir: path.resolve(__dirname, 'build'), + buildDir: path.resolve(__dirname, "build"), // Path where the Hass.io frontend will be publicly available. - publicPath: '/api/hassio/app', -} + publicPath: "/api/hassio/app", +}; diff --git a/hassio/script/gen-icons.js b/hassio/script/gen-icons.js index f53390153f..213f20e07c 100755 --- a/hassio/script/gen-icons.js +++ b/hassio/script/gen-icons.js @@ -1,15 +1,12 @@ #!/usr/bin/env node -const fs = require('fs'); -const { - findIcons, - generateIconset, -} = require('../../gulp/tasks/gen-icons.js'); +const fs = require("fs"); +const { findIcons, generateIconset } = require("../../gulp/tasks/gen-icons.js"); -const MENU_BUTTON_ICON = 'menu'; +const MENU_BUTTON_ICON = "menu"; function genHassioIcons() { - const iconNames = findIcons('./src', 'hassio').concat(MENU_BUTTON_ICON); - fs.writeFileSync('./hassio-icons.html', generateIconset('hassio', iconNames)); + const iconNames = findIcons("./src", "hassio").concat(MENU_BUTTON_ICON); + fs.writeFileSync("./hassio-icons.html", generateIconset("hassio", iconNames)); } genHassioIcons(); diff --git a/hassio/src/addon-store/hassio-addon-repository.js b/hassio/src/addon-store/hassio-addon-repository.js index 4b3c0d537f..6c8e36d973 100644 --- a/hassio/src/addon-store/hassio-addon-repository.js +++ b/hassio/src/addon-store/hassio-addon-repository.js @@ -1,10 +1,10 @@ -import '@polymer/paper-card/paper-card.js'; -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import "@polymer/paper-card/paper-card.js"; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import '../components/hassio-card-content.js'; -import '../resources/hassio-style.js'; -import NavigateMixin from '../../../src/mixins/navigate-mixin.js'; +import "../components/hassio-card-content.js"; +import "../resources/hassio-style.js"; +import NavigateMixin from "../../../src/mixins/navigate-mixin.js"; class HassioAddonRepository extends NavigateMixin(PolymerElement) { static get template() { @@ -52,17 +52,23 @@ class HassioAddonRepository extends NavigateMixin(PolymerElement) { } computeIcon(addon) { - return addon.installed && addon.installed !== addon.version ? 'hassio:arrow-up-bold-circle' : 'hassio:puzzle'; + return addon.installed && addon.installed !== addon.version + ? "hassio:arrow-up-bold-circle" + : "hassio:puzzle"; } computeIconTitle(addon) { - if (addon.installed) return addon.installed !== addon.version ? 'New version available' : 'Add-on is installed'; - return 'Add-on is not installed'; + if (addon.installed) + return addon.installed !== addon.version + ? "New version available" + : "Add-on is installed"; + return "Add-on is not installed"; } computeIconClass(addon) { - if (addon.installed) return addon.installed !== addon.version ? 'update' : 'installed'; - return ''; + if (addon.installed) + return addon.installed !== addon.version ? "update" : "installed"; + return ""; } addonTapped(ev) { @@ -70,4 +76,4 @@ class HassioAddonRepository extends NavigateMixin(PolymerElement) { } } -customElements.define('hassio-addon-repository', HassioAddonRepository); +customElements.define("hassio-addon-repository", HassioAddonRepository); diff --git a/hassio/src/addon-store/hassio-addon-store.js b/hassio/src/addon-store/hassio-addon-store.js index 05566f1578..129e5b58ad 100644 --- a/hassio/src/addon-store/hassio-addon-store.js +++ b/hassio/src/addon-store/hassio-addon-store.js @@ -1,8 +1,8 @@ -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import './hassio-addon-repository.js'; -import './hassio-repositories-editor.js'; +import "./hassio-addon-repository.js"; +import "./hassio-repositories-editor.js"; class HassioAddonStore extends PolymerElement { static get template() { @@ -30,7 +30,7 @@ class HassioAddonStore extends PolymerElement { ready() { super.ready(); - this.addEventListener('hass-api-called', ev => this.apiCalled(ev)); + this.addEventListener("hass-api-called", (ev) => this.apiCalled(ev)); this.loadData(); } @@ -41,42 +41,45 @@ class HassioAddonStore extends PolymerElement { } sortRepos(a, b) { - if (a.slug === 'local') { + if (a.slug === "local") { return -1; - } if (b.slug === 'local') { + } + if (b.slug === "local") { return 1; - } if (a.slug === 'core') { + } + if (a.slug === "core") { return -1; - } if (b.slug === 'core') { + } + if (b.slug === "core") { return 1; } return a.name < b.name ? -1 : 1; } computeAddons(repo) { - return this.addons.filter(function (addon) { + return this.addons.filter(function(addon) { return addon.repository === repo; }); } loadData() { - this.hass.callApi('get', 'hassio/addons') - .then((info) => { + this.hass.callApi("get", "hassio/addons").then( + (info) => { this.addons = info.data.addons; this.repos = info.data.repositories; - }, () => { + }, + () => { this.addons = []; this.repos = []; - }); + } + ); } - refreshData() { - this.hass.callApi('post', 'hassio/addons/reload') - .then(() => { - this.loadData(); - }); + this.hass.callApi("post", "hassio/addons/reload").then(() => { + this.loadData(); + }); } } -customElements.define('hassio-addon-store', HassioAddonStore); +customElements.define("hassio-addon-store", HassioAddonStore); diff --git a/hassio/src/addon-store/hassio-repositories-editor.js b/hassio/src/addon-store/hassio-repositories-editor.js index de4783ade2..3a07a9269f 100644 --- a/hassio/src/addon-store/hassio-repositories-editor.js +++ b/hassio/src/addon-store/hassio-repositories-editor.js @@ -1,12 +1,12 @@ -import '@polymer/iron-icon/iron-icon.js'; -import '@polymer/paper-card/paper-card.js'; -import '@polymer/paper-input/paper-input.js'; -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import "@polymer/iron-icon/iron-icon.js"; +import "@polymer/paper-card/paper-card.js"; +import "@polymer/paper-input/paper-input.js"; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import '../../../src/components/buttons/ha-call-api-button.js'; -import '../components/hassio-card-content.js'; -import '../resources/hassio-style.js'; +import "../../../src/components/buttons/ha-call-api-button.js"; +import "../components/hassio-card-content.js"; +import "../resources/hassio-style.js"; class HassioRepositoriesEditor extends PolymerElement { static get template() { @@ -60,7 +60,7 @@ class HassioRepositoriesEditor extends PolymerElement { hass: Object, repos: { type: Array, - observer: 'reposChanged', + observer: "reposChanged", }, repoList: Array, repoUrl: String, @@ -68,8 +68,10 @@ class HassioRepositoriesEditor extends PolymerElement { } reposChanged(repos) { - this.repoList = repos.filter(repo => repo.slug !== 'core' && repo.slug !== 'local'); - this.repoUrl = ''; + this.repoList = repos.filter( + (repo) => repo.slug !== "core" && repo.slug !== "local" + ); + this.repoUrl = ""; } sortRepos(a, b) { @@ -77,15 +79,17 @@ class HassioRepositoriesEditor extends PolymerElement { } computeRemoveRepoData(repoList, url) { - const list = repoList.filter(repo => repo.url !== url).map(repo => repo.url); + const list = repoList + .filter((repo) => repo.url !== url) + .map((repo) => repo.url); return { addons_repositories: list }; } computeAddRepoData(repoList, url) { - const list = repoList ? repoList.map(repo => repo.url) : []; + const list = repoList ? repoList.map((repo) => repo.url) : []; list.push(url); return { addons_repositories: list }; } } -customElements.define('hassio-repositories-editor', HassioRepositoriesEditor); +customElements.define("hassio-repositories-editor", HassioRepositoriesEditor); diff --git a/hassio/src/addon-view/hassio-addon-audio.js b/hassio/src/addon-view/hassio-addon-audio.js index 3286da55a0..0f03169cda 100644 --- a/hassio/src/addon-view/hassio-addon-audio.js +++ b/hassio/src/addon-view/hassio-addon-audio.js @@ -1,15 +1,15 @@ -import 'web-animations-js/web-animations-next-lite.min.js'; +import "web-animations-js/web-animations-next-lite.min.js"; -import '@polymer/paper-button/paper-button.js'; -import '@polymer/paper-card/paper-card.js'; -import '@polymer/paper-dropdown-menu/paper-dropdown-menu.js'; -import '@polymer/paper-item/paper-item.js'; -import '@polymer/paper-listbox/paper-listbox.js'; -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import "@polymer/paper-button/paper-button.js"; +import "@polymer/paper-card/paper-card.js"; +import "@polymer/paper-dropdown-menu/paper-dropdown-menu.js"; +import "@polymer/paper-item/paper-item.js"; +import "@polymer/paper-listbox/paper-listbox.js"; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import '../../../src/resources/ha-style.js'; -import EventsMixin from '../../../src/mixins/events-mixin.js'; +import "../../../src/resources/ha-style.js"; +import EventsMixin from "../../../src/mixins/events-mixin.js"; class HassioAddonAudio extends EventsMixin(PolymerElement) { static get template() { @@ -64,7 +64,7 @@ class HassioAddonAudio extends EventsMixin(PolymerElement) { hass: Object, addon: { type: Object, - observer: 'addonChanged' + observer: "addonChanged", }, inputDevices: Array, outputDevices: Array, @@ -76,40 +76,55 @@ class HassioAddonAudio extends EventsMixin(PolymerElement) { addonChanged(addon) { this.setProperties({ - selectedInput: addon.audio_input || 'null', - selectedOutput: addon.audio_output || 'null' + selectedInput: addon.audio_input || "null", + selectedOutput: addon.audio_output || "null", }); if (this.outputDevices) return; - const noDevice = [{ device: 'null', name: '-' }]; - this.hass.callApi('get', 'hassio/hardware/audio').then((resp) => { - const dev = resp.data.audio; - const input = Object.keys(dev.input).map(key => ({ device: key, name: dev.input[key] })); - const output = Object.keys(dev.output).map(key => ({ device: key, name: dev.output[key] })); - this.setProperties({ - inputDevices: noDevice.concat(input), - outputDevices: noDevice.concat(output) - }); - }, () => { - this.setProperties({ - inputDevices: noDevice, - outputDevices: noDevice - }); - }); + const noDevice = [{ device: "null", name: "-" }]; + this.hass.callApi("get", "hassio/hardware/audio").then( + (resp) => { + const dev = resp.data.audio; + const input = Object.keys(dev.input).map((key) => ({ + device: key, + name: dev.input[key], + })); + const output = Object.keys(dev.output).map((key) => ({ + device: key, + name: dev.output[key], + })); + this.setProperties({ + inputDevices: noDevice.concat(input), + outputDevices: noDevice.concat(output), + }); + }, + () => { + this.setProperties({ + inputDevices: noDevice, + outputDevices: noDevice, + }); + } + ); } _saveSettings() { this.error = null; const path = `hassio/addons/${this.addon.slug}/options`; - this.hass.callApi('post', path, { - audio_input: this.selectedInput === 'null' ? null : this.selectedInput, - audio_output: this.selectedOutput === 'null' ? null : this.selectedOutput - }).then(() => { - this.fire('hass-api-called', { success: true, path: path }); - }, (resp) => { - this.error = resp.body.message; - }); + this.hass + .callApi("post", path, { + audio_input: this.selectedInput === "null" ? null : this.selectedInput, + audio_output: + this.selectedOutput === "null" ? null : this.selectedOutput, + }) + .then( + () => { + this.fire("hass-api-called", { success: true, path: path }); + }, + (resp) => { + this.error = resp.body.message; + } + ); } } -customElements.define('hassio-addon-audio', HassioAddonAudio); +customElements.define("hassio-addon-audio", HassioAddonAudio); diff --git a/hassio/src/addon-view/hassio-addon-config.js b/hassio/src/addon-view/hassio-addon-config.js index 9d7b275ec4..3ae1361d65 100644 --- a/hassio/src/addon-view/hassio-addon-config.js +++ b/hassio/src/addon-view/hassio-addon-config.js @@ -1,10 +1,10 @@ -import '@polymer/iron-autogrow-textarea/iron-autogrow-textarea.js'; -import '@polymer/paper-button/paper-button.js'; -import '@polymer/paper-card/paper-card.js'; -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import "@polymer/iron-autogrow-textarea/iron-autogrow-textarea.js"; +import "@polymer/paper-button/paper-button.js"; +import "@polymer/paper-card/paper-card.js"; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import '../../../src/components/buttons/ha-call-api-button.js'; +import "../../../src/components/buttons/ha-call-api-button.js"; class HassioAddonConfig extends PolymerElement { static get template() { @@ -52,12 +52,12 @@ class HassioAddonConfig extends PolymerElement { hass: Object, addon: { type: Object, - observer: 'addonChanged', + observer: "addonChanged", }, addonSlug: String, config: { type: String, - observer: 'configChanged', + observer: "configChanged", }, configParsed: Object, error: String, @@ -71,15 +71,15 @@ class HassioAddonConfig extends PolymerElement { } addonChanged(addon) { - this.config = addon ? JSON.stringify(addon.options, null, 2) : ''; + this.config = addon ? JSON.stringify(addon.options, null, 2) : ""; } configChanged(config) { try { - this.$.config.classList.remove('syntaxerror'); + this.$.config.classList.remove("syntaxerror"); this.configParsed = JSON.parse(config); } catch (err) { - this.$.config.classList.add('syntaxerror'); + this.$.config.classList.add("syntaxerror"); this.configParsed = null; } } @@ -87,12 +87,14 @@ class HassioAddonConfig extends PolymerElement { saveTapped() { this.error = null; - this.hass.callApi('post', `hassio/addons/${this.addonSlug}/options`, { - options: this.configParsed - }).catch((resp) => { - this.error = resp.body.message; - }); + this.hass + .callApi("post", `hassio/addons/${this.addonSlug}/options`, { + options: this.configParsed, + }) + .catch((resp) => { + this.error = resp.body.message; + }); } } -customElements.define('hassio-addon-config', HassioAddonConfig); +customElements.define("hassio-addon-config", HassioAddonConfig); diff --git a/hassio/src/addon-view/hassio-addon-info.js b/hassio/src/addon-view/hassio-addon-info.js index a5e1946153..fb18a5695a 100644 --- a/hassio/src/addon-view/hassio-addon-info.js +++ b/hassio/src/addon-view/hassio-addon-info.js @@ -1,16 +1,16 @@ -import '@polymer/iron-icon/iron-icon.js'; -import '@polymer/paper-button/paper-button.js'; -import '@polymer/paper-card/paper-card.js'; -import '@polymer/paper-toggle-button/paper-toggle-button.js'; -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import "@polymer/iron-icon/iron-icon.js"; +import "@polymer/paper-button/paper-button.js"; +import "@polymer/paper-card/paper-card.js"; +import "@polymer/paper-toggle-button/paper-toggle-button.js"; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import '../../../src/components/buttons/ha-call-api-button.js'; -import '../../../src/components/ha-markdown.js'; -import '../../../src/resources/ha-style.js'; -import EventsMixin from '../../../src/mixins/events-mixin.js'; +import "../../../src/components/buttons/ha-call-api-button.js"; +import "../../../src/components/ha-markdown.js"; +import "../../../src/resources/ha-style.js"; +import EventsMixin from "../../../src/mixins/events-mixin.js"; -import '../components/hassio-card-content.js'; +import "../components/hassio-card-content.js"; class HassioAddonInfo extends EventsMixin(PolymerElement) { static get template() { @@ -157,21 +157,26 @@ class HassioAddonInfo extends EventsMixin(PolymerElement) { addonSlug: String, isRunning: { type: Boolean, - computed: 'computeIsRunning(addon)', + computed: "computeIsRunning(addon)", }, }; } computeIsRunning(addon) { - return addon && addon.state === 'started'; + return addon && addon.state === "started"; } computeUpdateAvailable(addon) { - return addon && !addon.detached && addon.version && addon.version !== addon.last_version; + return ( + addon && + !addon.detached && + addon.version && + addon.version !== addon.last_version + ); } pathWebui(webui) { - return webui && webui.replace('[HOST]', document.location.hostname); + return webui && webui.replace("[HOST]", document.location.hostname); } computeShowWebUI(webui, isRunning) { @@ -179,49 +184,54 @@ class HassioAddonInfo extends EventsMixin(PolymerElement) { } computeStartOnBoot(state) { - return state === 'auto'; + return state === "auto"; } startOnBootToggled() { - const data = { boot: this.addon.boot === 'auto' ? 'manual' : 'auto' }; - this.hass.callApi('POST', `hassio/addons/${this.addonSlug}/options`, data); + const data = { boot: this.addon.boot === "auto" ? "manual" : "auto" }; + this.hass.callApi("POST", `hassio/addons/${this.addonSlug}/options`, data); } autoUpdateToggled() { const data = { auto_update: !this.addon.auto_update }; - this.hass.callApi('POST', `hassio/addons/${this.addonSlug}/options`, data); + this.hass.callApi("POST", `hassio/addons/${this.addonSlug}/options`, data); } openChangelog() { - this.hass.callApi('get', `hassio/addons/${this.addonSlug}/changelog`) - .then( - resp => resp, - () => 'Error getting changelog' - ).then((content) => { - this.fire('hassio-markdown-dialog', { - title: 'Changelog', + this.hass + .callApi("get", `hassio/addons/${this.addonSlug}/changelog`) + .then((resp) => resp, () => "Error getting changelog") + .then((content) => { + this.fire("hassio-markdown-dialog", { + title: "Changelog", content: content, }); }); } _unistallClicked() { - if (!confirm('Are you sure you want to uninstall this add-on?')) { + if (!confirm("Are you sure you want to uninstall this add-on?")) { return; } const path = `hassio/addons/${this.addonSlug}/uninstall`; const eventData = { path: path, }; - this.hass.callApi('post', path).then((resp) => { - eventData.success = true; - eventData.response = resp; - }, (resp) => { - eventData.success = false; - eventData.response = resp; - }).then(() => { - this.fire('hass-api-called', eventData); - }); + this.hass + .callApi("post", path) + .then( + (resp) => { + eventData.success = true; + eventData.response = resp; + }, + (resp) => { + eventData.success = false; + eventData.response = resp; + } + ) + .then(() => { + this.fire("hass-api-called", eventData); + }); } } -customElements.define('hassio-addon-info', HassioAddonInfo); +customElements.define("hassio-addon-info", HassioAddonInfo); diff --git a/hassio/src/addon-view/hassio-addon-logs.js b/hassio/src/addon-view/hassio-addon-logs.js index 8655607461..baa1a4c63f 100644 --- a/hassio/src/addon-view/hassio-addon-logs.js +++ b/hassio/src/addon-view/hassio-addon-logs.js @@ -1,9 +1,9 @@ -import '@polymer/paper-button/paper-button.js'; -import '@polymer/paper-card/paper-card.js'; -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import "@polymer/paper-button/paper-button.js"; +import "@polymer/paper-card/paper-card.js"; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import '../../../src/resources/ha-style.js'; +import "../../../src/resources/ha-style.js"; class HassioAddonLogs extends PolymerElement { static get template() { @@ -33,7 +33,7 @@ class HassioAddonLogs extends PolymerElement { hass: Object, addonSlug: { type: String, - observer: 'addonSlugChanged', + observer: "addonSlugChanged", }, log: String, }; @@ -41,7 +41,9 @@ class HassioAddonLogs extends PolymerElement { addonSlugChanged(slug) { if (!this.hass) { - setTimeout(() => { this.addonChanged(slug); }, 0); + setTimeout(() => { + this.addonChanged(slug); + }, 0); return; } @@ -49,11 +51,12 @@ class HassioAddonLogs extends PolymerElement { } refresh() { - this.hass.callApi('get', `hassio/addons/${this.addonSlug}/logs`) + this.hass + .callApi("get", `hassio/addons/${this.addonSlug}/logs`) .then((info) => { this.log = info; }); } } -customElements.define('hassio-addon-logs', HassioAddonLogs); +customElements.define("hassio-addon-logs", HassioAddonLogs); diff --git a/hassio/src/addon-view/hassio-addon-network.js b/hassio/src/addon-view/hassio-addon-network.js index 33d6f28d9c..770ea2eef7 100644 --- a/hassio/src/addon-view/hassio-addon-network.js +++ b/hassio/src/addon-view/hassio-addon-network.js @@ -1,11 +1,11 @@ -import '@polymer/paper-card/paper-card.js'; -import '@polymer/paper-input/paper-input.js'; -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import "@polymer/paper-card/paper-card.js"; +import "@polymer/paper-input/paper-input.js"; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import '../../../src/components/buttons/ha-call-api-button.js'; -import '../../../src/resources/ha-style.js'; -import EventsMixin from '../../../src/mixins/events-mixin.js'; +import "../../../src/components/buttons/ha-call-api-button.js"; +import "../../../src/resources/ha-style.js"; +import EventsMixin from "../../../src/mixins/events-mixin.js"; class HassioAddonNetwork extends EventsMixin(PolymerElement) { static get template() { @@ -64,7 +64,7 @@ class HassioAddonNetwork extends EventsMixin(PolymerElement) { config: Object, addon: { type: Object, - observer: 'addonChanged', + observer: "addonChanged", }, error: String, resetData: { @@ -80,29 +80,36 @@ class HassioAddonNetwork extends EventsMixin(PolymerElement) { if (!addon) return; const network = addon.network || {}; - const items = Object.keys(network).map(key => ({ + const items = Object.keys(network).map((key) => ({ container: key, - host: network[key] + host: network[key], })); - this.config = items.sort(function (el1, el2) { return el1.host - el2.host; }); + this.config = items.sort(function(el1, el2) { + return el1.host - el2.host; + }); } saveTapped() { this.error = null; const data = {}; - this.config.forEach(function (item) { + this.config.forEach(function(item) { data[item.container] = parseInt(item.host); }); const path = `hassio/addons/${this.addonSlug}/options`; - this.hass.callApi('post', path, { - network: data - }).then(() => { - this.fire('hass-api-called', { success: true, path: path }); - }, (resp) => { - this.error = resp.body.message; - }); + this.hass + .callApi("post", path, { + network: data, + }) + .then( + () => { + this.fire("hass-api-called", { success: true, path: path }); + }, + (resp) => { + this.error = resp.body.message; + } + ); } } -customElements.define('hassio-addon-network', HassioAddonNetwork); +customElements.define("hassio-addon-network", HassioAddonNetwork); diff --git a/hassio/src/addon-view/hassio-addon-view.js b/hassio/src/addon-view/hassio-addon-view.js index f1a6bef2df..7fe9dc40ab 100644 --- a/hassio/src/addon-view/hassio-addon-view.js +++ b/hassio/src/addon-view/hassio-addon-view.js @@ -1,19 +1,19 @@ -import '@polymer/app-layout/app-header-layout/app-header-layout.js'; -import '@polymer/app-layout/app-header/app-header.js'; -import '@polymer/app-layout/app-toolbar/app-toolbar.js'; -import '@polymer/app-route/app-route.js'; -import '@polymer/paper-icon-button/paper-icon-button.js'; -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import "@polymer/app-layout/app-header-layout/app-header-layout.js"; +import "@polymer/app-layout/app-header/app-header.js"; +import "@polymer/app-layout/app-toolbar/app-toolbar.js"; +import "@polymer/app-route/app-route.js"; +import "@polymer/paper-icon-button/paper-icon-button.js"; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import '../../../src/components/ha-menu-button.js'; -import '../../../src/resources/ha-style.js'; -import '../hassio-markdown-dialog.js'; -import './hassio-addon-audio.js'; -import './hassio-addon-config.js'; -import './hassio-addon-info.js'; -import './hassio-addon-logs.js'; -import './hassio-addon-network.js'; +import "../../../src/components/ha-menu-button.js"; +import "../../../src/resources/ha-style.js"; +import "../hassio-markdown-dialog.js"; +import "./hassio-addon-audio.js"; +import "./hassio-addon-config.js"; +import "./hassio-addon-info.js"; +import "./hassio-addon-logs.js"; +import "./hassio-addon-network.js"; class HassioAddonView extends PolymerElement { static get template() { @@ -91,7 +91,7 @@ class HassioAddonView extends PolymerElement { route: Object, routeData: { type: Object, - observer: 'routeDataChanged', + observer: "routeDataChanged", }, routeMatches: Boolean, addon: Object, @@ -99,15 +99,17 @@ class HassioAddonView extends PolymerElement { markdownTitle: String, markdownContent: { type: String, - value: '', + value: "", }, }; } ready() { super.ready(); - this.addEventListener('hass-api-called', ev => this.apiCalled(ev)); - this.addEventListener('hassio-markdown-dialog', ev => this.openMarkdown(ev)); + this.addEventListener("hass-api-called", (ev) => this.apiCalled(ev)); + this.addEventListener("hassio-markdown-dialog", (ev) => + this.openMarkdown(ev) + ); } apiCalled(ev) { @@ -115,7 +117,7 @@ class HassioAddonView extends PolymerElement { if (!path) return; - if (path.substr(path.lastIndexOf('/') + 1) === 'uninstall') { + if (path.substr(path.lastIndexOf("/") + 1) === "uninstall") { this.backTapped(); } else { this.routeDataChanged(this.routeData); @@ -124,12 +126,14 @@ class HassioAddonView extends PolymerElement { routeDataChanged(routeData) { if (!this.routeMatches || !routeData || !routeData.slug) return; - this.hass.callApi('get', `hassio/addons/${routeData.slug}/info`) - .then((info) => { + this.hass.callApi("get", `hassio/addons/${routeData.slug}/info`).then( + (info) => { this.addon = info.data; - }, () => { + }, + () => { this.addon = null; - }); + } + ); } backTapped() { @@ -141,8 +145,8 @@ class HassioAddonView extends PolymerElement { markdownTitle: ev.detail.title, markdownContent: ev.detail.content, }); - this.shadowRoot.querySelector('hassio-markdown-dialog').openDialog(); + this.shadowRoot.querySelector("hassio-markdown-dialog").openDialog(); } } -customElements.define('hassio-addon-view', HassioAddonView); +customElements.define("hassio-addon-view", HassioAddonView); diff --git a/hassio/src/components/hassio-card-content.js b/hassio/src/components/hassio-card-content.js index 98c56d3dc3..84d2db9655 100644 --- a/hassio/src/components/hassio-card-content.js +++ b/hassio/src/components/hassio-card-content.js @@ -1,8 +1,8 @@ -import '@polymer/iron-icon/iron-icon.js'; -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import "@polymer/iron-icon/iron-icon.js"; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import '../../../src/components/ha-relative-time.js'; +import "../../../src/components/ha-relative-time.js"; class HassioCardContent extends PolymerElement { static get template() { @@ -65,11 +65,11 @@ class HassioCardContent extends PolymerElement { datetime: String, icon: { type: String, - value: 'hass:help-circle' + value: "hass:help-circle", }, iconTitle: String, iconClass: String, }; } } -customElements.define('hassio-card-content', HassioCardContent); +customElements.define("hassio-card-content", HassioCardContent); diff --git a/hassio/src/dashboard/hassio-addons.js b/hassio/src/dashboard/hassio-addons.js index 02d031e833..d4f5a56535 100644 --- a/hassio/src/dashboard/hassio-addons.js +++ b/hassio/src/dashboard/hassio-addons.js @@ -1,10 +1,10 @@ -import '@polymer/paper-card/paper-card.js'; -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import "@polymer/paper-card/paper-card.js"; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import '../components/hassio-card-content.js'; -import '../resources/hassio-style.js'; -import NavigateMixin from '../../../src/mixins/navigate-mixin.js'; +import "../components/hassio-card-content.js"; +import "../resources/hassio-style.js"; +import NavigateMixin from "../../../src/mixins/navigate-mixin.js"; class HassioAddons extends NavigateMixin(PolymerElement) { static get template() { @@ -46,28 +46,32 @@ class HassioAddons extends NavigateMixin(PolymerElement) { } computeIcon(addon) { - return addon.installed !== addon.version ? 'hassio:arrow-up-bold-circle' : 'hassio:puzzle'; + return addon.installed !== addon.version + ? "hassio:arrow-up-bold-circle" + : "hassio:puzzle"; } computeIconTitle(addon) { - if (addon.installed !== addon.version) return 'New version available'; - return addon.state === 'started' ? 'Add-on is running' : 'Add-on is stopped'; + if (addon.installed !== addon.version) return "New version available"; + return addon.state === "started" + ? "Add-on is running" + : "Add-on is stopped"; } computeIconClass(addon) { - if (addon.installed !== addon.version) return 'update'; - return addon.state === 'started' ? 'running' : ''; + if (addon.installed !== addon.version) return "update"; + return addon.state === "started" ? "running" : ""; } addonTapped(ev) { - this.navigate('/hassio/addon/' + ev.model.addon.slug); + this.navigate("/hassio/addon/" + ev.model.addon.slug); ev.target.blur(); } openStore(ev) { - this.navigate('/hassio/store'); + this.navigate("/hassio/store"); ev.target.blur(); } } -customElements.define('hassio-addons', HassioAddons); +customElements.define("hassio-addons", HassioAddons); diff --git a/hassio/src/dashboard/hassio-dashboard.js b/hassio/src/dashboard/hassio-dashboard.js index da41ee9e19..3c9ecde4dd 100644 --- a/hassio/src/dashboard/hassio-dashboard.js +++ b/hassio/src/dashboard/hassio-dashboard.js @@ -1,9 +1,9 @@ -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import './hassio-addons.js'; -import './hassio-hass-update.js'; -import EventsMixin from '../../../src/mixins/events-mixin.js'; +import "./hassio-addons.js"; +import "./hassio-hass-update.js"; +import EventsMixin from "../../../src/mixins/events-mixin.js"; class HassioDashboard extends EventsMixin(PolymerElement) { static get template() { @@ -29,4 +29,4 @@ class HassioDashboard extends EventsMixin(PolymerElement) { } } -customElements.define('hassio-dashboard', HassioDashboard); +customElements.define("hassio-dashboard", HassioDashboard); diff --git a/hassio/src/dashboard/hassio-hass-update.js b/hassio/src/dashboard/hassio-hass-update.js index 6daad74249..dd7df1f429 100644 --- a/hassio/src/dashboard/hassio-hass-update.js +++ b/hassio/src/dashboard/hassio-hass-update.js @@ -1,11 +1,11 @@ -import '@polymer/paper-button/paper-button.js'; -import '@polymer/paper-card/paper-card.js'; -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import "@polymer/paper-button/paper-button.js"; +import "@polymer/paper-card/paper-card.js"; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import '../../../src/components/buttons/ha-call-api-button.js'; -import '../components/hassio-card-content.js'; -import '../resources/hassio-style.js'; +import "../../../src/components/buttons/ha-call-api-button.js"; +import "../components/hassio-card-content.js"; +import "../resources/hassio-style.js"; class HassioHassUpdate extends PolymerElement { static get template() { @@ -56,7 +56,7 @@ class HassioHassUpdate extends PolymerElement { ready() { super.ready(); - this.addEventListener('hass-api-called', ev => this.apiCalled(ev)); + this.addEventListener("hass-api-called", (ev) => this.apiCalled(ev)); } apiCalled(ev) { @@ -67,8 +67,8 @@ class HassioHassUpdate extends PolymerElement { const response = ev.detail.response; - if (typeof response.body === 'object') { - this.errors = response.body.message || 'Unknown error'; + if (typeof response.body === "object") { + this.errors = response.body.message || "Unknown error"; } else { this.errors = response.body; } @@ -79,4 +79,4 @@ class HassioHassUpdate extends PolymerElement { } } -customElements.define('hassio-hass-update', HassioHassUpdate); +customElements.define("hassio-hass-update", HassioHassUpdate); diff --git a/hassio/src/entrypoint.js b/hassio/src/entrypoint.js index aa86165e05..7b726bf1bb 100644 --- a/hassio/src/entrypoint.js +++ b/hassio/src/entrypoint.js @@ -1,4 +1,4 @@ window.loadES5Adapter().then(() => { - import(/* webpackChunkName: "hassio-icons" */ './resources/hassio-icons.js'); - import(/* webpackChunkName: "hassio-main" */ './hassio-main.js'); + import(/* webpackChunkName: "hassio-icons" */ "./resources/hassio-icons.js"); + import(/* webpackChunkName: "hassio-main" */ "./hassio-main.js"); }); diff --git a/hassio/src/hassio-app.js b/hassio/src/hassio-app.js index e104da964f..c85962b6e2 100644 --- a/hassio/src/hassio-app.js +++ b/hassio/src/hassio-app.js @@ -1,8 +1,8 @@ -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import './hassio-main.js'; -import './resources/hassio-icons.js'; +import "./hassio-main.js"; +import "./resources/hassio-icons.js"; class HassioApp extends PolymerElement { static get template() { @@ -29,13 +29,13 @@ class HassioApp extends PolymerElement { ready() { super.ready(); window.setProperties = this.setProperties.bind(this); - this.addEventListener('location-changed', () => this._locationChanged()); - this.addEventListener('hass-open-menu', () => this._menuEvent(true)); - this.addEventListener('hass-close-menu', () => this._menuEvent(false)); + this.addEventListener("location-changed", () => this._locationChanged()); + this.addEventListener("hass-open-menu", () => this._menuEvent(true)); + this.addEventListener("hass-close-menu", () => this._menuEvent(false)); } _menuEvent(shouldOpen) { - this.hassioPanel.fire(shouldOpen ? 'hass-open-menu' : 'hass-close-menu'); + this.hassioPanel.fire(shouldOpen ? "hass-open-menu" : "hass-close-menu"); } _locationChanged() { @@ -43,4 +43,4 @@ class HassioApp extends PolymerElement { } } -customElements.define('hassio-app', HassioApp); +customElements.define("hassio-app", HassioApp); diff --git a/hassio/src/hassio-data.js b/hassio/src/hassio-data.js index 127142287e..39795402e9 100644 --- a/hassio/src/hassio-data.js +++ b/hassio/src/hassio-data.js @@ -1,4 +1,4 @@ -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; class HassioData extends PolymerElement { static get properties() { @@ -36,25 +36,24 @@ class HassioData extends PolymerElement { } fetchSupervisorInfo() { - return this.hass.callApi('get', 'hassio/supervisor/info') - .then((info) => { - this.supervisor = info.data; - }); + return this.hass.callApi("get", "hassio/supervisor/info").then((info) => { + this.supervisor = info.data; + }); } fetchHostInfo() { - return this.hass.callApi('get', 'hassio/host/info') - .then((info) => { - this.host = info.data; - }); + return this.hass.callApi("get", "hassio/host/info").then((info) => { + this.host = info.data; + }); } fetchHassInfo() { - return this.hass.callApi('get', 'hassio/homeassistant/info') + return this.hass + .callApi("get", "hassio/homeassistant/info") .then((info) => { this.homeassistant = info.data; }); } } -customElements.define('hassio-data', HassioData); +customElements.define("hassio-data", HassioData); diff --git a/hassio/src/hassio-main.js b/hassio/src/hassio-main.js index 0122e69cab..b18745edb2 100644 --- a/hassio/src/hassio-main.js +++ b/hassio/src/hassio-main.js @@ -1,15 +1,15 @@ -import '@polymer/app-route/app-route.js'; -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import "@polymer/app-route/app-route.js"; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import '../../src/layouts/hass-loading-screen.js'; -import './addon-view/hassio-addon-view.js'; -import './hassio-data.js'; -import './hassio-pages-with-tabs.js'; +import "../../src/layouts/hass-loading-screen.js"; +import "./addon-view/hassio-addon-view.js"; +import "./hassio-data.js"; +import "./hassio-pages-with-tabs.js"; -import applyThemesOnElement from '../../src/common/dom/apply_themes_on_element.js'; -import EventsMixin from '../../src/mixins/events-mixin.js'; -import NavigateMixin from '../../src/mixins/navigate-mixin.js'; +import applyThemesOnElement from "../../src/common/dom/apply_themes_on_element.js"; +import EventsMixin from "../../src/mixins/events-mixin.js"; +import NavigateMixin from "../../src/mixins/navigate-mixin.js"; class HassioMain extends EventsMixin(NavigateMixin(PolymerElement)) { static get template() { @@ -41,11 +41,11 @@ class HassioMain extends EventsMixin(NavigateMixin(PolymerElement)) { type: Object, // Fake route object value: { - prefix: '/hassio', - path: '/dashboard', - __queryParams: {} + prefix: "/hassio", + path: "/dashboard", + __queryParams: {}, }, - observer: 'routeChanged', + observer: "routeChanged", }, routeData: Object, supervisorInfo: Object, @@ -53,7 +53,7 @@ class HassioMain extends EventsMixin(NavigateMixin(PolymerElement)) { hassInfo: Object, loaded: { type: Boolean, - computed: 'computeIsLoaded(supervisorInfo, hostInfo, hassInfo)', + computed: "computeIsLoaded(supervisorInfo, hostInfo, hassInfo)", }, }; } @@ -61,7 +61,7 @@ class HassioMain extends EventsMixin(NavigateMixin(PolymerElement)) { ready() { super.ready(); applyThemesOnElement(this, this.hass.themes, this.hass.selectedTheme, true); - this.addEventListener('hass-api-called', ev => this.apiCalled(ev)); + this.addEventListener("hass-api-called", (ev) => this.apiCalled(ev)); } connectedCallback() { @@ -74,7 +74,7 @@ class HassioMain extends EventsMixin(NavigateMixin(PolymerElement)) { let tries = 1; const tryUpdate = () => { - this.$.data.refresh().catch(function () { + this.$.data.refresh().catch(function() { tries += 1; setTimeout(tryUpdate, Math.min(tries, 5) * 1000); }); @@ -85,21 +85,19 @@ class HassioMain extends EventsMixin(NavigateMixin(PolymerElement)) { } computeIsLoaded(supervisorInfo, hostInfo, hassInfo) { - return (supervisorInfo !== null - && hostInfo !== null - && hassInfo !== null); + return supervisorInfo !== null && hostInfo !== null && hassInfo !== null; } routeChanged(route) { - if (route.path === '' && route.prefix === '/hassio') { - this.navigate('/hassio/dashboard', true); + if (route.path === "" && route.prefix === "/hassio") { + this.navigate("/hassio/dashboard", true); } - this.fire('iron-resize'); + this.fire("iron-resize"); } equalsAddon(page) { - return page && page === 'addon'; + return page && page === "addon"; } } -customElements.define('hassio-main', HassioMain); +customElements.define("hassio-main", HassioMain); diff --git a/hassio/src/hassio-markdown-dialog.js b/hassio/src/hassio-markdown-dialog.js index 368cec0e27..c12cf283bd 100644 --- a/hassio/src/hassio-markdown-dialog.js +++ b/hassio/src/hassio-markdown-dialog.js @@ -1,12 +1,12 @@ -import '@polymer/app-layout/app-toolbar/app-toolbar.js'; -import '@polymer/paper-dialog-scrollable/paper-dialog-scrollable.js'; -import '@polymer/paper-dialog/paper-dialog.js'; -import '@polymer/paper-icon-button/paper-icon-button.js'; -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import "@polymer/app-layout/app-toolbar/app-toolbar.js"; +import "@polymer/paper-dialog-scrollable/paper-dialog-scrollable.js"; +import "@polymer/paper-dialog/paper-dialog.js"; +import "@polymer/paper-icon-button/paper-icon-button.js"; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import '../../src/components/ha-markdown.js'; -import '../../src/resources/ha-style.js'; +import "../../src/components/ha-markdown.js"; +import "../../src/resources/ha-style.js"; class HassioMarkdownDialog extends PolymerElement { static get template() { @@ -73,4 +73,4 @@ class HassioMarkdownDialog extends PolymerElement { this.$.dialog.open(); } } -customElements.define('hassio-markdown-dialog', HassioMarkdownDialog); +customElements.define("hassio-markdown-dialog", HassioMarkdownDialog); diff --git a/hassio/src/hassio-pages-with-tabs.js b/hassio/src/hassio-pages-with-tabs.js index 5c7f99c204..d9ad4247a1 100644 --- a/hassio/src/hassio-pages-with-tabs.js +++ b/hassio/src/hassio-pages-with-tabs.js @@ -1,24 +1,24 @@ -import '@polymer/app-layout/app-header-layout/app-header-layout.js'; -import '@polymer/app-layout/app-header/app-header.js'; -import '@polymer/app-layout/app-toolbar/app-toolbar.js'; -import '@polymer/paper-icon-button/paper-icon-button.js'; -import '@polymer/paper-tabs/paper-tab.js'; -import '@polymer/paper-tabs/paper-tabs.js'; -import { html } from '@polymer/polymer/lib/utils/html-tag.js'; -import { PolymerElement } from '@polymer/polymer/polymer-element.js'; +import "@polymer/app-layout/app-header-layout/app-header-layout.js"; +import "@polymer/app-layout/app-header/app-header.js"; +import "@polymer/app-layout/app-toolbar/app-toolbar.js"; +import "@polymer/paper-icon-button/paper-icon-button.js"; +import "@polymer/paper-tabs/paper-tab.js"; +import "@polymer/paper-tabs/paper-tabs.js"; +import { html } from "@polymer/polymer/lib/utils/html-tag.js"; +import { PolymerElement } from "@polymer/polymer/polymer-element.js"; -import '../../src/components/ha-menu-button.js'; -import '../../src/resources/ha-style.js'; -import './addon-store/hassio-addon-store.js'; -import './dashboard/hassio-dashboard.js'; -import './hassio-markdown-dialog.js'; -import './snapshots/hassio-snapshot.js'; -import './snapshots/hassio-snapshots.js'; -import './system/hassio-system.js'; +import "../../src/components/ha-menu-button.js"; +import "../../src/resources/ha-style.js"; +import "./addon-store/hassio-addon-store.js"; +import "./dashboard/hassio-dashboard.js"; +import "./hassio-markdown-dialog.js"; +import "./snapshots/hassio-snapshot.js"; +import "./snapshots/hassio-snapshots.js"; +import "./system/hassio-system.js"; -import scrollToTarget from '../../src/common/dom/scroll-to-target.js'; +import scrollToTarget from "../../src/common/dom/scroll-to-target.js"; -import NavigateMixin from '../../src/mixins/navigate-mixin.js'; +import NavigateMixin from "../../src/mixins/navigate-mixin.js"; class HassioPagesWithTabs extends NavigateMixin(PolymerElement) { static get template() { @@ -87,18 +87,20 @@ class HassioPagesWithTabs extends NavigateMixin(PolymerElement) { markdownTitle: String, markdownContent: { type: String, - value: '', + value: "", }, }; } ready() { super.ready(); - this.addEventListener('hassio-markdown-dialog', ev => this.openMarkdown(ev)); + this.addEventListener("hassio-markdown-dialog", (ev) => + this.openMarkdown(ev) + ); } handlePageSelected(ev) { - const newPage = ev.detail.item.getAttribute('page-name'); + const newPage = ev.detail.item.getAttribute("page-name"); if (newPage !== this.page) { this.navigate(`/hassio/${newPage}`); } @@ -110,14 +112,14 @@ class HassioPagesWithTabs extends NavigateMixin(PolymerElement) { } showRefreshButton(page) { - return page === 'store' || page === 'snapshots'; + return page === "store" || page === "snapshots"; } refreshClicked() { - if (this.page === 'snapshots') { - this.shadowRoot.querySelector('hassio-snapshots').refreshData(); + if (this.page === "snapshots") { + this.shadowRoot.querySelector("hassio-snapshots").refreshData(); } else { - this.shadowRoot.querySelector('hassio-addon-store').refreshData(); + this.shadowRoot.querySelector("hassio-addon-store").refreshData(); } } @@ -126,8 +128,8 @@ class HassioPagesWithTabs extends NavigateMixin(PolymerElement) { markdownTitle: ev.detail.title, markdownContent: ev.detail.content, }); - this.shadowRoot.querySelector('hassio-markdown-dialog').openDialog(); + this.shadowRoot.querySelector("hassio-markdown-dialog").openDialog(); } } -customElements.define('hassio-pages-with-tabs', HassioPagesWithTabs); +customElements.define("hassio-pages-with-tabs", HassioPagesWithTabs); diff --git a/hassio/src/resources/hassio-icons.js b/hassio/src/resources/hassio-icons.js index 451b336eb1..5f347236ab 100644 --- a/hassio/src/resources/hassio-icons.js +++ b/hassio/src/resources/hassio-icons.js @@ -1,7 +1,7 @@ -import '../../../src/components/ha-iconset-svg.js'; -import iconSetContent from '../../hassio-icons.html'; +import "../../../src/components/ha-iconset-svg.js"; +import iconSetContent from "../../hassio-icons.html"; -const documentContainer = document.createElement('template'); -documentContainer.setAttribute('style', 'display: none;'); +const documentContainer = document.createElement("template"); +documentContainer.setAttribute("style", "display: none;"); documentContainer.innerHTML = iconSetContent; document.head.appendChild(documentContainer.content); diff --git a/hassio/src/resources/hassio-style.js b/hassio/src/resources/hassio-style.js index 17a798ad17..1541329c45 100644 --- a/hassio/src/resources/hassio-style.js +++ b/hassio/src/resources/hassio-style.js @@ -1,5 +1,5 @@ -const documentContainer = document.createElement('template'); -documentContainer.setAttribute('style', 'display: none;'); +const documentContainer = document.createElement("template"); +documentContainer.setAttribute("style", "display: none;"); documentContainer.innerHTML = `