diff --git a/demo/src/configs/arsaboo/lovelace.ts b/demo/src/configs/arsaboo/lovelace.ts index bc21e15c71..fa387e600e 100644 --- a/demo/src/configs/arsaboo/lovelace.ts +++ b/demo/src/configs/arsaboo/lovelace.ts @@ -1,49 +1,7 @@ import { LovelaceConfig } from "../../../../src/data/lovelace"; export const demoLovelaceArsaboo: () => LovelaceConfig = () => ({ - resources: [ - // { - // url: "/local/custom_ui/weather-card.js?v=0.23", - // type: "module", - // }, - // { - // url: "/local/custom_ui/pc-card.js?v=0.2", - // type: "module", - // }, - // { - // url: "/local/custom_ui/circle-sensor-card.js", - // type: "module", - // }, - // { - // url: "/local/custom_ui/monster-card.js?v=1", - // type: "js", - // }, - // { - // url: "/local/custom_ui/thermostat-card.js?v=1.3", - // type: "module", - // }, - // { - // url: "/local/custom_ui/calendar-card.js", - // type: "module", - // }, - // { - // url: "https://unpkg.com/moment@2.22.2/moment.js", - // type: "js", - // }, - // { - // url: "/local/custom_ui/slider-entity-row.js?v=0.3", - // type: "js", - // }, - // { - // url: "/local/custom_ui/button-card.js?v=0.11", - // type: "module", - // }, - // { - // url: "/local/mini-media-player-bundle.js?v=0.0.1", - // type: "module", - // }, - ], - title: "ARS Home", + title: "Home Assistant", views: [ { icon: "hass:home-assistant", @@ -528,7 +486,8 @@ export const demoLovelaceArsaboo: () => LovelaceConfig = () => ({ { type: "iframe", aspect_ratio: "90%", - url: "https://embed.windy.com/embed2.html?lat=32.487&lon=-84.023&zoom=5&level=surface&overlay=rain&menu=&message=&marker=&calendar=&pressure=&type=map&location=coordinates&detail=&detailLat=32.487&detailLon=--84.023&metricWind=default&metricTemp=default&radarRange=-1", + url: + "https://embed.windy.com/embed2.html?zoom=5&level=surface&overlay=rain&menu=&message=&marker=&calendar=&pressure=&type=map&location=coordinates&detail=&detailLat=32.487&detailLon=--84.023&metricWind=default&metricTemp=default&radarRange=-1", }, { type: "entities", @@ -627,1998 +586,5 @@ export const demoLovelaceArsaboo: () => LovelaceConfig = () => ({ }, ], }, - { - icon: "hass:information-outline", - id: "home-assistant", - title: "Home Assistant", - cards: [ - { - type: "markdown", - content: - "## What is Home Assistant?\nHome Assistant is open source home automation software, that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server.", - }, - { - entities: [ - { - url: "https://www.home-assistant.io/", - type: "weblink", - name: "Home Assistant", - icon: "mdi:home-assistant", - }, - { - url: "https://www.home-assistant.io/getting-started/", - type: "weblink", - name: "Getting Started", - icon: "mdi:download", - }, - { - url: "https://www.home-assistant.io/cookbook/", - type: "weblink", - name: "Configuration Examples", - icon: "mdi:home-heart", - }, - { - url: "https://community.home-assistant.io/", - type: "weblink", - name: "Forum", - icon: "mdi:forum", - }, - { - url: "https://discord.gg/c5DvZ4e", - type: "weblink", - name: "Chat", - icon: "mdi:chat", - }, - ], - show_header_toggle: false, - type: "entities", - title: "Useful Links", - }, - ], - }, - // { - // icon: "mdi:weather-cloudy", - // id: "weather", - // title: "Weather", - // cards: [ - // { - // type: "custom:weather-card", - // entity: "weather.dark_sky", - // icons: "/assets/arsaboo/icons/weather_icons/animated/", - // }, - // { - // type: "entities", - // title: "Weather", - // show_header_toggle: false, - // entities: [ - // "sensor.dark_sky_summary", - // "sensor.pollen_level", - // "sensor.cold_flu_risk", - // "sensor.dark_sky_hourly_summary", - // "sensor.dark_sky_daily_summary", - // ], - // }, - // { - // type: "entities", - // title: "Room Sensors", - // show_header_toggle: false, - // entities: [ - // "sensor.illumination_158d00016612af", - // "sensor.humidity_158d0001ab7d20", - // "sensor.pressure_158d0001ab7d20", - // "sensor.temperature_158d0001ab7d20", - // { - // type: "divider", - // }, - // "sensor.humidity_158d0001ab3c88", - // "sensor.pressure_158d0001ab3c88", - // "sensor.temperature_158d0001ab3c88", - // { - // type: "divider", - // }, - // "sensor.humidity_158d0001ab3b2b", - // "sensor.pressure_158d0001ab3b2b", - // "sensor.temperature_158d0001ab3b2b", - // { - // type: "divider", - // }, - // "sensor.illumination_34ce00813670", - // "sensor.illumination_158d0001a1f2ab", - // "binary_sensor.water_leak_sensor_158d0001d77800", - // "sensor.leeoalarmstatus", - // ], - // }, - // { - // type: "picture-entity", - // entity: "camera.meteogram", - // }, - // { - // type: "iframe", - // aspect_ratio: "90%", - // url: "https://embed.windy.com/embed2.html?rain,32.487,-84.023,5", - // }, - // ], - // }, - // { - // icon: "mdi:chart-line", - // id: "grafana", - // title: "Grafana", - // cards: [ - // { - // type: "vertical-stack", - // cards: [ - // { - // type: "thermostat", - // entity: "climate.downstairs", - // }, - // { - // type: "glance", - // entities: [ - // { - // entity: "sensor.downstairsthermoper", - // name: "Operation", - // }, - // { - // entity: "sensor.downstairs_humidity", - // name: "Humidity", - // }, - // { - // entity: "sensor.living_room_temperature", - // name: "Temperature", - // }, - // { - // entity: "sensor.downstairs_hvac_runtime", - // name: "Runtime", - // }, - // { - // entity: "switch.downstairs_away", - // tap_action: { - // action: "toggle", - // }, - // name: "Away", - // }, - // ], - // }, - // { - // type: "picture-entity", - // entity: "camera.grafana_temp_down", - // show_name: false, - // show_state: false, - // }, - // { - // type: "picture-entity", - // entity: "camera.grafana_mode_down", - // show_name: false, - // show_state: false, - // }, - // ], - // }, - // { - // type: "vertical-stack", - // cards: [ - // { - // type: "thermostat", - // entity: "climate.upstairs", - // }, - // { - // type: "glance", - // entities: [ - // { - // entity: "sensor.upstairsthermoper", - // name: "Operation", - // }, - // { - // entity: "sensor.upstairs_humidity", - // name: "Humidity", - // }, - // { - // entity: "sensor.upstairs_temperature", - // name: "Temperature", - // }, - // { - // entity: "sensor.upstairs_hvac_runtime", - // name: "Runtime", - // }, - // { - // entity: "switch.upstairs_away", - // tap_action: { - // action: "toggle", - // }, - // name: "Away", - // }, - // ], - // }, - // { - // type: "picture-entity", - // entity: "camera.grafana_temp_up", - // show_name: false, - // show_state: false, - // }, - // { - // type: "picture-entity", - // entity: "camera.grafana_mode_up", - // show_name: false, - // show_state: false, - // }, - // ], - // }, - // { - // type: "vertical-stack", - // cards: [ - // { - // type: "thermostat", - // entity: "climate.bedroom", - // }, - // { - // type: "glance", - // entities: [ - // { - // entity: "sensor.masterthermoper", - // name: "Operation", - // }, - // { - // entity: "sensor.bedroom_humidity", - // name: "Humidity", - // }, - // { - // entity: "sensor.master_temperature", - // name: "Temperature", - // }, - // { - // entity: "sensor.master_hvac_runtime", - // name: "Runtime", - // }, - // { - // entity: "switch.bedroom_away", - // tap_action: { - // action: "toggle", - // }, - // name: "Away", - // }, - // ], - // }, - // { - // type: "picture-entity", - // entity: "camera.grafana_temp_master", - // show_name: false, - // show_state: false, - // }, - // { - // type: "picture-entity", - // entity: "camera.grafana_mode_master", - // show_name: false, - // show_state: false, - // }, - // ], - // }, - // { - // type: "picture-entity", - // entity: "camera.grafana_portfolio", - // show_name: false, - // show_state: false, - // }, - // { - // type: "picture-entity", - // entity: "camera.grafana_networth", - // show_name: false, - // show_state: false, - // }, - // ], - // }, - // // { - // // icon: "mdi:cctv", - // // id: "cameras", - // // title: "Cameras", - // // cards: [ - // // { - // // type: "picture-entity", - // // entity: "camera.driveway", - // // show_name: false, - // // show_state: false, - // // }, - // // { - // // type: "picture-entity", - // // entity: "camera.patio", - // // show_name: false, - // // show_state: false, - // // }, - // // { - // // type: "picture-entity", - // // entity: "camera.porch", - // // show_name: false, - // // show_state: false, - // // }, - // // { - // // type: "picture-entity", - // // entity: "camera.backyard", - // // show_name: false, - // // show_state: false, - // // }, - // // { - // // type: "picture-entity", - // // entity: "camera.arlo3", - // // }, - // // { - // // type: "picture-entity", - // // entity: "camera.arlolivingroom", - // // }, - // // { - // // type: "picture-entity", - // // entity: "camera.livingroom2", - // // }, - // // { - // // type: "picture-entity", - // // entity: "camera.front_door", - // // }, - // // { - // // type: "picture-entity", - // // entity: "camera.worldtime", - // // show_name: false, - // // show_state: false, - // // }, - // // { - // // type: "picture-entity", - // // entity: "camera.ars_bloom", - // // show_name: false, - // // show_state: false, - // // }, - // // { - // // type: "picture-entity", - // // entity: "camera.driveway_tf", - // // show_name: false, - // // show_state: false, - // // }, - // // { - // // type: "picture-entity", - // // entity: "camera.porch_tf", - // // show_name: false, - // // show_state: false, - // // }, - // // { - // // type: "picture-entity", - // // entity: "camera.patio_tf", - // // show_name: false, - // // show_state: false, - // // }, - // // { - // // type: "picture-entity", - // // entity: "camera.backyard_tf", - // // show_name: false, - // // show_state: false, - // // }, - // // ], - // // }, - // { - // icon: "mdi:play-circle-outline", - // id: "media", - // title: "Media", - // cards: [ - // { - // type: "entities", - // title: "Entertainment", - // show_header_toggle: false, - // entities: [ - // "sensor.living_room", - // "input_select.livingroomharmony", - // "input_select.hdmiswitcher", - // "input_select.hdmiinput", - // "input_number.harmonyvolume", - // "sensor.total_tv_time", - // "sensor.sonos_audio_in", - // "script.tv_off", - // ], - // }, - // { - // type: "entities", - // title: "Players", - // show_header_toggle: false, - // entities: [ - // "media_player.livingroomsonos", - // "media_player.family_room_2", - // "media_player.kodi_nstv", - // "media_player.echo_dot_gen2", - // "media_player.living_room_home", - // "media_player.living_room_speaker", - // "media_player.living_room_tv", - // "media_player.shield", - // ], - // }, - // { - // type: "vertical-stack", - // cards: [ - // { - // type: "horizontal-stack", - // cards: [ - // { - // type: "custom:button-card", - // color_type: "blank-card", - // }, - // { - // type: "custom:button-card", - // entity: "switch.sonos_speech_enhance", - // name: "Speech", - // icon: "mdi:comment-check-outline", - // default_color: "rgb(255, 255, 255)", - // color: "rgb(28, 128, 199)", - // action: "toggle", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "font-weight": "bold", - // }, - // ], - // }, - // { - // type: "custom:button-card", - // entity: "switch.sonos_night_sound", - // name: "Night", - // icon: "mdi:weather-night", - // color: "rgb(28, 128, 199)", - // action: "toggle", - // default_color: "rgb(255, 255, 255)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "font-weight": "bold", - // }, - // ], - // }, - // { - // type: "custom:button-card", - // color_type: "blank-card", - // }, - // ], - // }, - // { - // type: "horizontal-stack", - // cards: [ - // { - // type: "custom:button-card", - // color_type: "blank-card", - // }, - // { - // type: "custom:button-card", - // color_type: "card", - // color: "rgb(223, 255, 97)", - // icon: "mdi:volume-minus", - // style: [ - // { - // height: "50px", - // }, - // ], - // action: "service", - // service: { - // domain: "media_player", - // action: "volume_down", - // data: { - // entity_id: "media_player.family_room_2", - // }, - // }, - // }, - // { - // type: "custom:button-card", - // entity: "sensor.sonos_volume", - // color_type: "icon", - // show_state: true, - // color: "rgb(223, 255, 97)", - // style: [ - // { - // height: "50px", - // }, - // ], - // action: "more_info", - // }, - // { - // type: "custom:button-card", - // color_type: "card", - // color: "rgb(223, 255, 97)", - // icon: "mdi:volume-plus", - // style: [ - // { - // height: "50px", - // }, - // ], - // action: "service", - // service: { - // domain: "media_player", - // action: "volume_up", - // data: { - // entity_id: "media_player.family_room_2", - // }, - // }, - // }, - // { - // type: "custom:button-card", - // color_type: "blank-card", - // }, - // ], - // }, - // { - // type: "horizontal-stack", - // cards: [ - // { - // type: "custom:button-card", - // color_type: "blank-card", - // }, - // { - // type: "custom:button-card", - // color_type: "card", - // color: "rgb(223, 255, 97)", - // icon: "mdi:plex", - // action: "service", - // service: { - // domain: "rest_command", - // action: "plex", - // }, - // }, - // { - // type: "custom:button-card", - // color_type: "card", - // color: "rgb(223, 255, 97)", - // icon: "mdi:youtube", - // action: "service", - // service: { - // domain: "rest_command", - // action: "youtube", - // }, - // }, - // { - // type: "custom:button-card", - // color_type: "card", - // color: "rgb(223, 255, 97)", - // icon: "mdi:netflix", - // action: "service", - // service: { - // domain: "rest_command", - // action: "netflix", - // }, - // }, - // { - // type: "custom:button-card", - // color_type: "blank-card", - // }, - // ], - // }, - // ], - // }, - // { - // type: "entities", - // title: "Light Operations", - // show_header_toggle: false, - // entities: [ - // "input_boolean.partymode", - // "script.sonoslinein", - // "script.colorloop_start", - // "script.disco_party", - // "script.lifx_stop_effects", - // "script.master_colorloop", - // "script.master_random", - // ], - // }, - // { - // type: "media-control", - // entity: "media_player.livingroomsonos", - // }, - // { - // type: "media-control", - // entity: "media_player.family_room_2", - // }, - // { - // type: "media-control", - // entity: "media_player.kodi_nstv", - // }, - // { - // type: "media-control", - // entity: "media_player.echo_dot_gen2", - // }, - // { - // type: "media-control", - // entity: "media_player.living_room_home", - // }, - // { - // type: "media-control", - // entity: "media_player.living_room_tv", - // }, - // { - // type: "media-control", - // entity: "media_player.shield", - // }, - // ], - // }, - // { - // icon: "mdi:settings", - // id: "settings", - // title: "Settings", - // cards: [ - // { - // type: "horizontal-stack", - // cards: [ - // { - // type: "picture-entity", - // entity: "device_tracker.rashmiphone_rashmiphone", - // show_name: false, - // show_state: false, - // state_image: { - // home: "/assets/arsaboo/icons/rashmi_owntracks_home.png", - // not_home: "/assets/arsaboo/icons/rashmi_owntracks_not_home.png", - // }, - // }, - // { - // type: "picture-entity", - // entity: "device_tracker.rashmiappiphone", - // show_name: false, - // show_state: false, - // state_image: { - // home: "/assets/arsaboo/icons/rashmi_ios_home.png", - // not_home: "/assets/arsaboo/icons/rashmi_ios_not_home.png", - // }, - // }, - // { - // type: "picture-entity", - // entity: "device_tracker.rashmisiphone", - // show_name: false, - // show_state: false, - // state_image: { - // home: "/assets/arsaboo/icons/rashmi_wifi_home.png", - // not_home: "/assets/arsaboo/icons/rashmi_wifi_not_home.png", - // }, - // }, - // { - // type: "picture-entity", - // entity: "device_tracker.sonu_sonu", - // show_name: false, - // show_state: false, - // state_image: { - // home: "/assets/arsaboo/icons/rashmi_life360_home.png", - // not_home: "/assets/arsaboo/icons/rashmi_life360_not_home.png", - // }, - // }, - // { - // type: "picture-entity", - // entity: "device_tracker.e1594e53_21df_414c_82da_f655d5282fca", - // show_name: false, - // show_state: false, - // state_image: { - // home: "/assets/arsaboo/icons/rashmi_geofency_home.png", - // not_home: "/assets/arsaboo/icons/rashmi_geofency_not_home.png", - // }, - // }, - // ], - // }, - // { - // type: "horizontal-stack", - // cards: [ - // { - // type: "picture-entity", - // entity: "device_tracker.alokphone_alokphone", - // show_name: false, - // show_state: false, - // state_image: { - // home: "/assets/arsaboo/icons/alok_owntracks_home.png", - // not_home: "/assets/arsaboo/icons/alok_owntracks_not_home.png", - // Buckhead: "/assets/arsaboo/icons/alok_owntracks_not_home.png", - // Downtown: "/assets/arsaboo/icons/alok_owntracks_not_home.png", - // }, - // }, - // { - // type: "picture-entity", - // entity: "device_tracker.alokiosiphone", - // show_name: false, - // show_state: false, - // state_image: { - // home: "/assets/arsaboo/icons/alok_ios_home.png", - // not_home: "/assets/arsaboo/icons/alok_ios_not_home.png", - // Buckhead: "/assets/arsaboo/icons/alok_ios_not_home.png", - // Downtown: "/assets/arsaboo/icons/alok_ios_not_home.png", - // }, - // }, - // { - // type: "picture-entity", - // entity: "device_tracker.myiphone", - // show_name: false, - // show_state: false, - // state_image: { - // home: "/assets/arsaboo/icons/alok_wifi_home.png", - // not_home: "/assets/arsaboo/icons/alok_wifi_not_home.png", - // }, - // }, - // { - // type: "picture-entity", - // entity: "device_tracker.alok_alok", - // show_name: false, - // show_state: false, - // state_image: { - // home: "/assets/arsaboo/icons/alok_life360_home.png", - // not_home: "/assets/arsaboo/icons/alok_life360_not_home.png", - // Buckhead: "/assets/arsaboo/icons/alok_life360_not_home.png", - // Downtown: "/assets/arsaboo/icons/alok_life360_not_home.png", - // }, - // }, - // { - // type: "picture-entity", - // entity: "device_tracker.b4445761_f6c0_4b7f_835f_cfdc03b47111", - // show_name: false, - // show_state: false, - // state_image: { - // home: "/assets/arsaboo/icons/alok_geofency_home.png", - // not_home: "/assets/arsaboo/icons/alok_geofency_not_home.png", - // buckhead: "/assets/arsaboo/icons/alok_geofency_not_home.png", - // downtown: "/assets/arsaboo/icons/alok_geofency_not_home.png", - // }, - // }, - // ], - // }, - // { - // type: "horizontal-stack", - // cards: [ - // { - // type: "picture-entity", - // entity: "device_tracker.meta_alok", - // state_image: { - // home: "/assets/arsaboo/icons/alok_home.png", - // not_home: "/assets/arsaboo/icons/alok_not_home.png", - // buckhead: "/assets/arsaboo/icons/alok_not_home.png", - // Buckhead: "/assets/arsaboo/icons/alok_not_home.png", - // downtown: "/assets/arsaboo/icons/alok_not_home.png", - // Downtown: "/assets/arsaboo/icons/alok_not_home.png", - // }, - // show_name: false, - // show_state: false, - // hold_action: { - // action: "toggle", - // }, - // }, - // { - // type: "picture-entity", - // entity: "device_tracker.meta_rashmi", - // state_image: { - // home: "/assets/arsaboo/icons/rashmi_home.png", - // not_home: "/assets/arsaboo/icons/rashmi_not_home.png", - // }, - // show_name: false, - // show_state: false, - // hold_action: { - // action: "toggle", - // }, - // }, - // ], - // }, - // { - // type: "entities", - // title: "HASS Details", - // show_header_toggle: false, - // entities: [ - // "sensor.ssl_certificate_expiry", - // "input_select.current_theme", - // "input_boolean.devmode", - // ], - // }, - // { - // type: "entities", - // title: "Camera Processing", - // show_header_toggle: false, - // entities: [ - // "script.classify_images", - // "image_processing.opencv_porch", - // "image_processing.opencv_patio", - // "image_processing.opencv_driveway", - // "image_processing.opencv_backyard", - // "image_processing.tensorflow_porch", - // "image_processing.tensorflow_patio", - // "image_processing.tensorflow_driveway", - // "image_processing.tensorflow_backyard", - // "image_processing.deepstack_porch", - // "image_processing.deepstack_patio", - // "image_processing.deepstack_driveway", - // "image_processing.deepstack_backyard", - // "image_processing.facebox_backyard", - // "image_processing.facebox_patio", - // "image_processing.facebox_driveway", - // "image_processing.facebox_porch", - // "image_processing.tagbox_backyard", - // "image_processing.tagbox_patio", - // "image_processing.tagbox_driveway", - // "image_processing.tagbox_porch", - // "image_processing.rekognition_driveway", - // ], - // }, - // { - // type: "entities", - // title: "Network Details", - // show_header_toggle: false, - // entities: [ - // "sensor.speedtest_download", - // "switch.pihole", - // { - // type: "divider", - // }, - // "sensor.glances_cpu_load", - // "sensor.glances_disk_used", - // "sensor.glances_ram_used", - // ], - // }, - // { - // type: "horizontal-stack", - // cards: [ - // { - // type: "custom:button-card", - // entity: "switch.arnav_s_ipad", - // name: "iPad", - // icon: "mdi:tablet-ipad", - // color: "rgb(250, 218, 79)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "text-transform": "capitalize", - // }, - // ], - // }, - // { - // type: "custom:button-card", - // entity: "switch.lenovo_home", - // name: "Lenovo", - // icon: "mdi:laptop-windows", - // color: "rgb(250, 218, 79)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "text-transform": "capitalize", - // }, - // ], - // }, - // { - // type: "custom:button-card", - // entity: "switch.rpi_aiy", - // name: "RPi AIY", - // icon: "mdi:raspberrypi", - // color: "rgb(250, 218, 79)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "text-transform": "capitalize", - // }, - // ], - // }, - // { - // type: "custom:button-card", - // entity: "switch.toshibaaio", - // name: "Toshiba", - // icon: "mdi:desktop-mac-dashboard", - // color: "rgb(250, 218, 79)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "text-transform": "capitalize", - // }, - // ], - // }, - // { - // type: "custom:button-card", - // entity: "switch.samsung_tv", - // name: "Samsung TV", - // icon: "mdi:television-classic", - // color: "rgb(250, 218, 79)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "text-transform": "capitalize", - // }, - // ], - // }, - // ], - // }, - // { - // type: "entities", - // title: "Arlo", - // show_header_toggle: false, - // entities: [ - // "sensor.battery_level_arlolivingroom", - // "sensor.captured_today_arlolivingroom", - // "sensor.signal_strength_arlolivingroom", - // "sensor.battery_level_livingroom2", - // "sensor.captured_today_livingroom2", - // "sensor.signal_strength_livingroom2", - // "sensor.battery_level_arlo3", - // "sensor.captured_today_arlo3", - // "sensor.signal_strength_arlo3", - // ], - // }, - // { - // type: "entities", - // title: "USCIS", - // show_header_toggle: false, - // entities: [ - // "sensor.alok_485", - // "sensor.rashmi_485", - // "sensor.arnav_485", - // ], - // }, - // ], - // }, - // { - // icon: "mdi:test-tube", - // id: "test", - // title: "Testing", - // cards: [ - // { - // type: "custom:pc-card", - // }, - // { - // type: "vertical-stack", - // cards: [ - // { - // type: "horizontal-stack", - // cards: [ - // { - // type: "gauge", - // name: "Dow Futures", - // unit: "%", - // entity: "sensor.dow_futures_change_pct", - // min: -8, - // max: 8, - // severity: { - // red: -8, - // yellow: -2, - // green: 0, - // }, - // }, - // { - // type: "gauge", - // name: "Technology", - // unit: "%", - // entity: "sensor.information_technology", - // min: -6, - // max: 6, - // severity: { - // red: -6, - // yellow: -2, - // green: 0, - // }, - // }, - // { - // type: "gauge", - // name: "Real Estate", - // unit: "%", - // entity: "sensor.real_estate", - // min: -6, - // max: 6, - // severity: { - // red: -6, - // yellow: -2, - // green: 0, - // }, - // }, - // ], - // }, - // { - // type: "horizontal-stack", - // cards: [ - // { - // type: "gauge", - // name: "Finance", - // unit: "%", - // entity: "sensor.financials", - // min: -6, - // max: 6, - // severity: { - // red: -6, - // yellow: -2, - // green: 0, - // }, - // }, - // { - // type: "gauge", - // name: "Industrial", - // unit: "%", - // entity: "sensor.industrials", - // min: -6, - // max: 6, - // severity: { - // red: -6, - // yellow: -2, - // green: 0, - // }, - // }, - // { - // type: "gauge", - // name: "Utilities", - // unit: "%", - // entity: "sensor.utilities", - // min: -6, - // max: 6, - // severity: { - // red: -6, - // yellow: -2, - // green: 0, - // }, - // }, - // ], - // }, - // { - // type: "horizontal-stack", - // cards: [ - // { - // type: "gauge", - // name: "Materials", - // unit: "%", - // entity: "sensor.materials", - // min: -6, - // max: 6, - // severity: { - // red: -6, - // yellow: -2, - // green: 0, - // }, - // }, - // { - // type: "gauge", - // name: "Telecom", - // unit: "%", - // entity: "sensor.communication_services", - // min: -6, - // max: 6, - // severity: { - // red: -6, - // yellow: -2, - // green: 0, - // }, - // }, - // { - // type: "gauge", - // name: "Energy", - // unit: "%", - // entity: "sensor.energy", - // min: -6, - // max: 6, - // severity: { - // red: -6, - // yellow: -2, - // green: 0, - // }, - // }, - // ], - // }, - // { - // type: "horizontal-stack", - // cards: [ - // { - // type: "gauge", - // name: "Staples", - // unit: "%", - // entity: "sensor.consumer_staples", - // min: -6, - // max: 6, - // severity: { - // red: -6, - // yellow: -2, - // green: 0, - // }, - // }, - // { - // type: "gauge", - // name: "Discretionary", - // unit: "%", - // entity: "sensor.consumer_discretionary", - // min: -6, - // max: 6, - // severity: { - // red: -6, - // yellow: -2, - // green: 0, - // }, - // }, - // { - // type: "gauge", - // name: "Health", - // unit: "%", - // entity: "sensor.health_care", - // min: -6, - // max: 6, - // severity: { - // red: -6, - // yellow: -2, - // green: 0, - // }, - // }, - // ], - // }, - // ], - // }, - // { - // type: "vertical-stack", - // cards: [ - // { - // type: "horizontal-stack", - // cards: [ - // { - // type: "custom:button-card", - // entity: "switch.backyardmotion", - // name: "Backyard", - // icon: "mdi:camera", - // color: "rgb(250, 218, 79)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "text-transform": "capitalize", - // }, - // ], - // }, - // { - // type: "custom:button-card", - // entity: "binary_sensor.backyard_motion", - // name: "Motion", - // icon: "mdi:run", - // action: "more_info", - // default_color: "rgb(255, 255, 255)", - // color: "rgb(250, 218, 79)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "text-transform": "capitalize", - // }, - // ], - // }, - // { - // type: "custom:button-card", - // entity: "binary_sensor.backyard_line_crossing", - // name: "Crossing", - // icon: "mdi:format-vertical-align-center", - // action: "more_info", - // color: "rgb(250, 218, 79)", - // default_color: "rgb(255, 255, 255)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "text-transform": "capitalize", - // }, - // ], - // }, - // { - // type: "custom:button-card", - // entity: "binary_sensor.backyard_field_detection", - // name: "Intrusion", - // icon: "mdi:aspect-ratio", - // action: "more_info", - // color: "rgb(250, 218, 79)", - // default_color: "rgb(255, 255, 255)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "text-transform": "capitalize", - // }, - // ], - // }, - // { - // type: "custom:button-card", - // entity: "binary_sensor.backyard_face_detection", - // name: "Face", - // icon: "mdi:face-outline", - // action: "more_info", - // color: "rgb(250, 218, 79)", - // default_color: "rgb(255, 255, 255)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "text-transform": "capitalize", - // }, - // ], - // }, - // ], - // }, - // { - // type: "horizontal-stack", - // cards: [ - // { - // type: "custom:button-card", - // entity: "switch.patiomotion", - // name: "Patio", - // icon: "mdi:camera", - // color: "rgb(250, 218, 79)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "text-transform": "capitalize", - // }, - // ], - // }, - // { - // type: "custom:button-card", - // entity: "binary_sensor.patio_motion", - // name: "Motion", - // icon: "mdi:run", - // action: "more_info", - // default_color: "rgb(255, 255, 255)", - // color: "rgb(250, 218, 79)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "text-transform": "capitalize", - // }, - // ], - // }, - // { - // type: "custom:button-card", - // entity: "binary_sensor.patio_line_crossing", - // name: "Crossing", - // icon: "mdi:format-vertical-align-center", - // action: "more_info", - // color: "rgb(250, 218, 79)", - // default_color: "rgb(255, 255, 255)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "text-transform": "capitalize", - // }, - // ], - // }, - // { - // type: "custom:button-card", - // entity: "binary_sensor.patio_field_detection", - // name: "Intrusion", - // icon: "mdi:aspect-ratio", - // action: "more_info", - // color: "rgb(250, 218, 79)", - // default_color: "rgb(255, 255, 255)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "text-transform": "capitalize", - // }, - // ], - // }, - // { - // type: "custom:button-card", - // entity: "binary_sensor.patio_face_detection", - // name: "Patio Face", - // icon: "mdi:face-outline", - // action: "more_info", - // color: "rgb(250, 218, 79)", - // default_color: "rgb(255, 255, 255)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "text-transform": "capitalize", - // }, - // ], - // }, - // ], - // }, - // { - // type: "horizontal-stack", - // cards: [ - // { - // type: "custom:button-card", - // entity: "switch.drivewaymotion", - // name: "Driveway", - // icon: "mdi:camera", - // color: "rgb(250, 218, 79)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "text-transform": "capitalize", - // }, - // ], - // }, - // { - // type: "custom:button-card", - // entity: "binary_sensor.driveway_motion", - // name: "Motion", - // icon: "mdi:run", - // action: "more_info", - // default_color: "rgb(255, 255, 255)", - // color: "rgb(250, 218, 79)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "text-transform": "capitalize", - // }, - // ], - // }, - // { - // type: "custom:button-card", - // entity: "binary_sensor.driveway_line_crossing", - // name: "Crossing", - // icon: "mdi:format-vertical-align-center", - // action: "more_info", - // color: "rgb(250, 218, 79)", - // default_color: "rgb(255, 255, 255)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "text-transform": "capitalize", - // }, - // ], - // }, - // { - // type: "custom:button-card", - // entity: "binary_sensor.driveway_field_detection", - // name: "Intrusion", - // icon: "mdi:aspect-ratio", - // action: "more_info", - // color: "rgb(250, 218, 79)", - // default_color: "rgb(255, 255, 255)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "text-transform": "capitalize", - // }, - // ], - // }, - // { - // type: "custom:button-card", - // entity: "binary_sensor.driveway_face_detection", - // name: "Face", - // icon: "mdi:face-outline", - // action: "more_info", - // color: "rgb(250, 218, 79)", - // default_color: "rgb(255, 255, 255)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "text-transform": "capitalize", - // }, - // ], - // }, - // ], - // }, - // { - // type: "horizontal-stack", - // cards: [ - // { - // type: "custom:button-card", - // entity: "switch.porchmotion", - // name: "Porch", - // icon: "mdi:camera", - // color: "rgb(250, 218, 79)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "text-transform": "capitalize", - // }, - // ], - // }, - // { - // type: "custom:button-card", - // entity: "binary_sensor.porch_motion", - // name: "Motion", - // icon: "mdi:run", - // action: "more_info", - // default_color: "rgb(255, 255, 255)", - // color: "rgb(250, 218, 79)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "text-transform": "capitalize", - // }, - // ], - // }, - // { - // type: "custom:button-card", - // entity: "binary_sensor.porch_line_crossing", - // name: "Crossing", - // icon: "mdi:format-vertical-align-center", - // action: "more_info", - // color: "rgb(250, 218, 79)", - // default_color: "rgb(255, 255, 255)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "text-transform": "capitalize", - // }, - // ], - // }, - // { - // type: "custom:button-card", - // entity: "binary_sensor.porch_field_detection", - // name: "Intrusion", - // icon: "mdi:aspect-ratio", - // action: "more_info", - // color: "rgb(250, 218, 79)", - // default_color: "rgb(255, 255, 255)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "text-transform": "capitalize", - // }, - // ], - // }, - // { - // type: "custom:button-card", - // entity: "binary_sensor.porch_face_detection", - // name: "Face", - // icon: "mdi:face-outline", - // action: "more_info", - // color: "rgb(250, 218, 79)", - // default_color: "rgb(255, 255, 255)", - // color_type: "icon", - // style: [ - // { - // "font-size": "12px", - // }, - // { - // "text-transform": "capitalize", - // }, - // ], - // }, - // ], - // }, - // ], - // }, - // { - // type: "custom:calendar-card", - // entities: [ - // "calendar.personal", - // "calendar.work", - // "calendar.us_holidays", - // ], - // }, - // { - // type: "sensor", - // entity: "sensor.illumination_158d00016c53bf", - // graph: "line", - // }, - // { - // type: "picture-elements", - // image: "/assets/arsaboo/icons/remote2.png", - // elements: [ - // { - // type: "image", - // image: "/assets/arsaboo/icons/music_right.png", - // title: "Right", - // style: { - // top: "79.5%", - // left: "57%", - // width: "8%", - // padding: "0px", - // opacity: 0, - // }, - // tap_action: { - // action: "call-service", - // }, - // service: "remote.send_command", - // service_data: { - // entity_id: "remote.livingroom", - // command: "DirectionRight", - // device: 31747959, - // }, - // }, - // { - // type: "image", - // image: "/assets/arsaboo/icons/music_left.png", - // title: "Left", - // tap_action: { - // action: "call-service", - // }, - // style: { - // top: "79.5%", - // left: "43%", - // width: "8%", - // padding: "0px", - // opacity: 0, - // }, - // service: "remote.send_command", - // service_data: { - // entity_id: "remote.livingroom", - // command: "DirectionLeft", - // device: 31747959, - // }, - // }, - // { - // type: "image", - // image: "/assets/arsaboo/icons/music_up.png", - // title: "Up", - // tap_action: { - // action: "call-service", - // }, - // style: { - // top: "72%", - // left: "50%", - // width: "8%", - // padding: "0px", - // opacity: 0, - // }, - // service: "remote.send_command", - // service_data: { - // entity_id: "remote.livingroom", - // command: "DirectionUp", - // device: 31747959, - // }, - // }, - // { - // type: "image", - // image: "/assets/arsaboo/icons/music_down.png", - // title: "Down", - // tap_action: { - // action: "call-service", - // }, - // style: { - // top: "87%", - // left: "50%", - // width: "8%", - // padding: "0px", - // opacity: 0, - // }, - // service: "remote.send_command", - // service_data: { - // entity_id: "remote.livingroom", - // command: "DirectionDown", - // device: 31747959, - // }, - // }, - // { - // type: "icon", - // icon: "mdi:minus", - // title: "Channel Down", - // tap_action: { - // action: "call-service", - // }, - // style: { - // top: "89%", - // left: "36.5%", - // width: "8%", - // padding: "0px", - // color: "rgb(54,64,74)", - // }, - // service: "remote.send_command", - // service_data: { - // entity_id: "remote.livingroom", - // command: "ChannelDown", - // device: 56988979, - // }, - // }, - // { - // type: "icon", - // icon: "mdi:plus", - // title: "Channel Up", - // tap_action: { - // action: "call-service", - // }, - // style: { - // top: "70.5%", - // left: "36.5%", - // width: "8%", - // padding: "0px", - // color: "rgb(54,64,74)", - // }, - // service: "remote.send_command", - // service_data: { - // entity_id: "remote.livingroom", - // command: "ChannelUp", - // device: 56988979, - // }, - // }, - // { - // type: "icon", - // icon: "mdi:volume-plus", - // title: "Volume Up", - // tap_action: { - // action: "call-service", - // }, - // style: { - // top: "70.6%", - // left: "67%", - // width: "7.5%", - // padding: "0px", - // color: "rgb(54,64,74)", - // }, - // service: "remote.send_command", - // service_data: { - // entity_id: "remote.livingroom", - // command: "VolumeUp", - // device: 31747960, - // }, - // }, - // { - // type: "icon", - // icon: "mdi:volume-minus", - // title: "Volume Down", - // tap_action: { - // action: "call-service", - // }, - // style: { - // top: "88.8%", - // left: "67%", - // width: "7.5%", - // padding: "0px", - // color: "rgb(54,64,74)", - // }, - // service: "remote.send_command", - // service_data: { - // entity_id: "remote.livingroom", - // command: "VolumeDown", - // device: 31747960, - // }, - // }, - // { - // type: "icon", - // icon: "mdi:circle", - // title: "Select", - // tap_action: { - // action: "call-service", - // }, - // style: { - // top: "79.6%", - // left: "49.6%", - // width: "7.5%", - // padding: "0px", - // opacity: 0, - // color: "rgb(54,64,74)", - // "--iron-icon-height": "40px", - // "--iron-icon-width": "40px", - // }, - // service: "remote.send_command", - // service_data: { - // entity_id: "remote.livingroom", - // command: "Select", - // device: 31747959, - // }, - // }, - // { - // type: "icon", - // icon: "mdi:numeric-1-box-outline", - // title: "Number 1", - // tap_action: { - // action: "call-service", - // }, - // style: { - // top: "27%", - // left: "36.5%", - // width: "7.5%", - // padding: "0px", - // color: "rgb(54,64,74)", - // }, - // service: "remote.send_command", - // service_data: { - // entity_id: "remote.livingroom", - // command: "Number1", - // device: 31747959, - // }, - // }, - // { - // type: "icon", - // icon: "mdi:numeric-2-box-outline", - // title: "Number 2", - // tap_action: { - // action: "call-service", - // }, - // style: { - // top: "27%", - // left: "51.5%", - // width: "7.5%", - // padding: "0px", - // color: "rgb(54,64,74)", - // }, - // service: "remote.send_command", - // service_data: { - // entity_id: "remote.livingroom", - // command: "Number2", - // device: 31747959, - // }, - // }, - // { - // type: "icon", - // icon: "mdi:numeric-3-box-outline", - // title: "Number 3", - // tap_action: { - // action: "call-service", - // }, - // style: { - // top: "27%", - // left: "66%", - // width: "7.5%", - // padding: "0px", - // color: "rgb(54,64,74)", - // }, - // service: "remote.send_command", - // service_data: { - // entity_id: "remote.livingroom", - // command: "Number3", - // device: 31747959, - // }, - // }, - // { - // type: "icon", - // icon: "mdi:numeric-4-box-outline", - // title: "Number 4", - // tap_action: { - // action: "call-service", - // }, - // style: { - // top: "37%", - // left: "36.5%", - // width: "7.5%", - // padding: "0px", - // color: "rgb(54,64,74)", - // }, - // service: "remote.send_command", - // service_data: { - // entity_id: "remote.livingroom", - // command: "Number4", - // device: 31747959, - // }, - // }, - // { - // type: "icon", - // icon: "mdi:numeric-5-box-outline", - // title: "Number 5", - // tap_action: { - // action: "call-service", - // }, - // style: { - // top: "37%", - // left: "51.5%", - // width: "7.5%", - // padding: "0px", - // color: "rgb(54,64,74)", - // }, - // service: "remote.send_command", - // service_data: { - // entity_id: "remote.livingroom", - // command: "Number5", - // device: 31747959, - // }, - // }, - // { - // type: "icon", - // icon: "mdi:numeric-6-box-outline", - // title: "Number 6", - // tap_action: { - // action: "call-service", - // }, - // style: { - // top: "37%", - // left: "66%", - // width: "7.5%", - // padding: "0px", - // color: "rgb(54,64,74)", - // }, - // service: "remote.send_command", - // service_data: { - // entity_id: "remote.livingroom", - // command: "Number6", - // device: 31747959, - // }, - // }, - // { - // type: "icon", - // icon: "mdi:numeric-7-box-outline", - // title: "Number 7", - // tap_action: { - // action: "call-service", - // }, - // style: { - // top: "47%", - // left: "36.5%", - // width: "7.5%", - // padding: "0px", - // color: "rgb(54,64,74)", - // }, - // service: "remote.send_command", - // service_data: { - // entity_id: "remote.livingroom", - // command: "Number7", - // device: 31747959, - // }, - // }, - // { - // type: "icon", - // icon: "mdi:numeric-8-box-outline", - // title: "Number 8", - // tap_action: { - // action: "call-service", - // }, - // style: { - // top: "47%", - // left: "51.5%", - // width: "7.5%", - // padding: "0px", - // color: "rgb(54,64,74)", - // }, - // service: "remote.send_command", - // service_data: { - // entity_id: "remote.livingroom", - // command: "Number8", - // device: 31747959, - // }, - // }, - // { - // type: "icon", - // icon: "mdi:numeric-9-box-outline", - // title: "Number 9", - // tap_action: { - // action: "call-service", - // }, - // style: { - // top: "47%", - // left: "66%", - // width: "7.5%", - // padding: "0px", - // color: "rgb(54,64,74)", - // }, - // service: "remote.send_command", - // service_data: { - // entity_id: "remote.livingroom", - // command: "Number9", - // device: 31747959, - // }, - // }, - // { - // type: "icon", - // icon: "mdi:numeric-0-box-outline", - // title: "Number 0", - // tap_action: { - // action: "call-service", - // }, - // style: { - // top: "57%", - // left: "51.5%", - // width: "7.5%", - // padding: "0px", - // color: "rgb(54,64,74)", - // }, - // service: "remote.send_command", - // service_data: { - // entity_id: "remote.livingroom", - // command: "Number0", - // device: 31747959, - // }, - // }, - // { - // type: "icon", - // icon: "mdi:kodi", - // title: "Kodi", - // tap_action: { - // action: "call-service", - // }, - // style: { - // top: "12%", - // left: "36.7%", - // width: "7.5%", - // padding: "0px", - // color: "rgb(54,64,74)", - // }, - // service: "remote.send_command", - // service_data: { - // entity_id: "remote.livingroom", - // activity: 18032761, - // }, - // }, - // { - // type: "icon", - // icon: "mdi:power", - // title: "Kodi", - // tap_action: { - // action: "call-service", - // }, - // style: { - // top: "12%", - // left: "66%", - // width: "7.5%", - // padding: "0px", - // color: "rgb(54,64,74)", - // }, - // service: "remote.send_command", - // service_data: { - // entity_id: "remote.livingroom", - // activity: "PowerOff", - // }, - // }, - // ], - // }, - // { - // type: "map", - // entities: [ - // { - // entity: "device_tracker.meta_alok", - // }, - // { - // entity: "device_tracker.meta_rashmi", - // }, - // "zone.home", - // ], - // }, - // { - // type: "conditional", - // conditions: [ - // { - // entity: "input_boolean.devmode", - // state: "on", - // }, - // ], - // card: { - // type: "custom:monster-card", - // card: { - // type: "entities", - // title: "All Automations", - // }, - // filter: { - // include: [ - // { - // domain: "automation", - // }, - // ], - // }, - // }, - // }, - // ], - // }, ], }); diff --git a/demo/src/custom-cards/ha-demo-card.ts b/demo/src/custom-cards/ha-demo-card.ts index fe3f7afe65..fe5b67bc6e 100644 --- a/demo/src/custom-cards/ha-demo-card.ts +++ b/demo/src/custom-cards/ha-demo-card.ts @@ -6,12 +6,9 @@ import { PropertyDeclarations, } from "lit-element"; import { until } from "lit-html/directives/until"; -import "@polymer/paper-icon-button"; import "@material/mwc-button"; import "@polymer/paper-spinner/paper-spinner-lite"; import "../../../src/components/ha-card"; -import "../../../src/components/ha-paper-icon-button-next"; -import "../../../src/components/ha-paper-icon-button-prev"; import { LovelaceCard, Lovelace } from "../../../src/panels/lovelace/types"; import { LovelaceCardConfig } from "../../../src/data/lovelace"; import { MockHomeAssistant } from "../../../src/fake_data/provide_hass"; @@ -49,11 +46,7 @@ export class HADemoCard extends LitElement implements LovelaceCard { return html`
- -
+
${this._switching ? html` @@ -73,16 +66,15 @@ export class HADemoCard extends LitElement implements LovelaceCard { "" )}
- + + Next demo +
-
+
Welcome home! You've reached the Home Assistant demo where we showcase the best UIs created by our community.
-
+
Learn more about Home Assistant @@ -91,14 +83,6 @@ export class HADemoCard extends LitElement implements LovelaceCard { `; } - private _prevConfig() { - this._updateConfig( - selectedDemoConfigIndex > 0 - ? selectedDemoConfigIndex - 1 - : demoConfigs.length - 1 - ); - } - private _nextConfig() { this._updateConfig( selectedDemoConfigIndex < demoConfigs.length - 1 @@ -125,6 +109,10 @@ export class HADemoCard extends LitElement implements LovelaceCard { color: var(--primary-color); } + .actions a { + text-decoration: none; + } + .content { padding: 16px; } @@ -136,17 +124,27 @@ export class HADemoCard extends LitElement implements LovelaceCard { height: 60px; } - .picker div { - text-align: center; + .picker mwc-button { + margin-right: 8px; } - .picker small { + .label { + padding-left: 16px; + } + + .label small { display: block; } .actions { padding-left: 8px; } + + @media only screen and (max-width: 500px) { + .small-hidden { + display: none; + } + } `, ]; } diff --git a/demo/src/html/index.html.template b/demo/src/html/index.html.template index 75d35675d0..489b15dcbe 100644 --- a/demo/src/html/index.html.template +++ b/demo/src/html/index.html.template @@ -87,7 +87,7 @@ #ha-init-skeleton::before { display: block; content: ""; - height: 112px; + height: 64px; background-color: #03a9f4; } diff --git a/setup.py b/setup.py index 893e62b35c..25dfab1ef2 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup, find_packages setup( name="home-assistant-frontend", - version="20190614.0", + version="20190618.0", description="The Home Assistant frontend", url="https://github.com/home-assistant/home-assistant-polymer", author="The Home Assistant Authors", diff --git a/src/common/dom/setup-leaflet-map.ts b/src/common/dom/setup-leaflet-map.ts index 70d282d1b2..bbbb03a104 100644 --- a/src/common/dom/setup-leaflet-map.ts +++ b/src/common/dom/setup-leaflet-map.ts @@ -4,7 +4,8 @@ import { Map } from "leaflet"; export type LeafletModuleType = typeof import("leaflet"); export const setupLeafletMap = async ( - mapElement: HTMLElement + mapElement: HTMLElement, + darkMode = false ): Promise<[Map, LeafletModuleType]> => { if (!mapElement.parentNode) { throw new Error("Cannot setup Leaflet map on disconnected element"); @@ -20,9 +21,9 @@ export const setupLeafletMap = async ( mapElement.parentNode.appendChild(style); map.setView([52.3731339, 4.8903147], 13); Leaflet.tileLayer( - `https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}${ - Leaflet.Browser.retina ? "@2x.png" : ".png" - }`, + `https://{s}.basemaps.cartocdn.com/${ + darkMode ? "dark_all" : "light_all" + }/{z}/{x}/{y}${Leaflet.Browser.retina ? "@2x.png" : ".png"}`, { attribution: '© OpenStreetMap, © CARTO', diff --git a/src/data/zha.ts b/src/data/zha.ts index dc759063fe..105bd93503 100644 --- a/src/data/zha.ts +++ b/src/data/zha.ts @@ -8,6 +8,7 @@ export interface ZHAEntityReference extends HassEntity { export interface ZHADevice { name: string; ieee: string; + nwk: string; manufacturer: string; model: string; quirk_applied: boolean; diff --git a/src/dialogs/more-info/controls/more-info-alarm_control_panel.js b/src/dialogs/more-info/controls/more-info-alarm_control_panel.js index 6f985d36d2..1a96927064 100644 --- a/src/dialogs/more-info/controls/more-info-alarm_control_panel.js +++ b/src/dialogs/more-info/controls/more-info-alarm_control_panel.js @@ -4,12 +4,10 @@ import "@polymer/paper-input/paper-input"; import { html } from "@polymer/polymer/lib/utils/html-tag"; import { PolymerElement } from "@polymer/polymer/polymer-element"; -import { EventsMixin } from "../../../mixins/events-mixin"; import LocalizeMixin from "../../../mixins/localize-mixin"; +import { fireEvent } from "../../../common/dom/fire_event"; -class MoreInfoAlarmControlPanel extends LocalizeMixin( - EventsMixin(PolymerElement) -) { +class MoreInfoAlarmControlPanel extends LocalizeMixin(PolymerElement) { static get template() { return html` @@ -187,7 +185,8 @@ class MoreInfoAlarmControlPanel extends LocalizeMixin( }, _codeValid: { type: Boolean, - computed: "_validateCode(_enteredCode, _codeFormat)", + computed: + "_validateCode(_enteredCode, _codeFormat, _armVisible, _codeArmRequired)", }, _disarmVisible: { type: Boolean, @@ -220,6 +219,7 @@ class MoreInfoAlarmControlPanel extends LocalizeMixin( const props = { _codeFormat: newVal.attributes.code_format, _armVisible: state === "disarmed", + _codeArmRequired: newVal.attributes.code_arm_required, _disarmVisible: this._armedStates.includes(state) || state === "pending" || @@ -231,7 +231,7 @@ class MoreInfoAlarmControlPanel extends LocalizeMixin( } if (oldVal) { setTimeout(() => { - this.fire("iron-resize"); + fireEvent(this, "iron-resize"); }, 500); } } @@ -240,8 +240,8 @@ class MoreInfoAlarmControlPanel extends LocalizeMixin( return format === "Number"; } - _validateCode(code, format) { - return !format || code.length > 0; + _validateCode(code, format, armVisible, codeArmRequired) { + return !format || code.length > 0 || (armVisible && !codeArmRequired); } _digitClicked(ev) { diff --git a/src/panels/config/zha/zha-add-devices-page.ts b/src/panels/config/zha/zha-add-devices-page.ts index 8080bc6c19..5adb181fd4 100644 --- a/src/panels/config/zha/zha-add-devices-page.ts +++ b/src/panels/config/zha/zha-add-devices-page.ts @@ -36,10 +36,10 @@ class ZHAAddDevicesPage extends LitElement { public connectedCallback(): void { super.connectedCallback(); - if (this.route && this.route.path && this.route.path !== "") { - this._ieeeAddress = this.route.path.substring(1); - } - this._subscribe(this._ieeeAddress); + this.route && this.route.path && this.route.path !== "" + ? (this._ieeeAddress = this.route.path.substring(1)) + : (this._ieeeAddress = undefined); + this._subscribe(); } public disconnectedCallback(): void { @@ -156,10 +156,10 @@ class ZHAAddDevicesPage extends LitElement { } } - private _subscribe(ieeeAddress: string | undefined): void { + private _subscribe(): void { const data: any = { type: "zha/devices/permit" }; - if (ieeeAddress) { - data.ieee = ieeeAddress; + if (this._ieeeAddress) { + data.ieee = this._ieeeAddress; } this._subscribed = this.hass!.connection.subscribeMessage( (message) => this._handleMessage(message), diff --git a/src/panels/config/zha/zha-device-card.ts b/src/panels/config/zha/zha-device-card.ts index 33b1f2cfbd..cf32d49a1d 100644 --- a/src/panels/config/zha/zha-device-card.ts +++ b/src/panels/config/zha/zha-device-card.ts @@ -36,6 +36,7 @@ import { HomeAssistant } from "../../../types"; import { ItemSelectedEvent, NodeServiceData } from "./types"; import { navigate } from "../../../common/navigate"; import { UnsubscribeFunc } from "home-assistant-js-websocket"; +import { formatAsPaddedHex } from "./functions"; declare global { // for fire event @@ -132,6 +133,8 @@ class ZHADeviceCard extends LitElement {
IEEE:
${this.device!.ieee}
+
Nwk:
+
${formatAsPaddedHex(this.device!.nwk)}
${ this.device!.quirk_applied ? html` diff --git a/src/panels/lovelace/cards/hui-map-card.ts b/src/panels/lovelace/cards/hui-map-card.ts index cc6db16db0..9211cb1d7c 100644 --- a/src/panels/lovelace/cards/hui-map-card.ts +++ b/src/panels/lovelace/cards/hui-map-card.ts @@ -180,7 +180,10 @@ class HuiMapCard extends LitElement implements LovelaceCard { } private async loadMap(): Promise { - [this._leafletMap, this.Leaflet] = await setupLeafletMap(this._mapEl); + [this._leafletMap, this.Leaflet] = await setupLeafletMap( + this._mapEl, + this._config !== undefined ? this._config.dark_mode !== false : false + ); this._drawEntities(); this._leafletMap.invalidateSize(); this._fitMap(); diff --git a/src/panels/lovelace/cards/types.ts b/src/panels/lovelace/cards/types.ts index 93240c6d16..06bd48569a 100644 --- a/src/panels/lovelace/cards/types.ts +++ b/src/panels/lovelace/cards/types.ts @@ -109,6 +109,7 @@ export interface MapCardConfig extends LovelaceCardConfig { default_zoom?: number; entities?: Array; geo_location_sources?: string[]; + dark_mode?: boolean; } export interface MarkdownCardConfig extends LovelaceCardConfig { diff --git a/src/panels/lovelace/editor/config-elements/hui-map-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-map-card-editor.ts index 0e43e36e88..1533baab38 100644 --- a/src/panels/lovelace/editor/config-elements/hui-map-card-editor.ts +++ b/src/panels/lovelace/editor/config-elements/hui-map-card-editor.ts @@ -37,6 +37,7 @@ const cardConfigStruct = struct({ title: "string?", aspect_ratio: "string?", default_zoom: "number?", + dark_mode: "boolean?", entities: [entitiesConfigStruct], geo_location_sources: "array?", }); @@ -71,6 +72,10 @@ export class HuiMapCardEditor extends LitElement implements LovelaceCardEditor { return this._config!.geo_location_sources || []; } + get _dark_mode(): boolean { + return this._config!.dark_mode || false; + } + protected render(): TemplateResult | void { if (!this.hass) { return html``; @@ -100,6 +105,12 @@ export class HuiMapCardEditor extends LitElement implements LovelaceCardEditor { @value-changed="${this._valueChanged}" >
+ Dark Mode?