state-icons everywhere. Use decluttering-card for state-icons

This commit is contained in:
2020-04-20 00:42:02 +03:00
parent e9d44b4c94
commit d411f1806c
2 changed files with 104 additions and 116 deletions
+78 -114
View File
@@ -1,7 +1,7 @@
custom_header: custom_header:
hide_header: true hide_header: true
decluttering_templates: !include_dir_merge_named lovelace/templates decluttering_templates: !include_dir_merge_named lovelace/decluttering_templates
title: Floorplan title: Floorplan
views: views:
@@ -270,86 +270,61 @@ views:
# ─── LIGHT SWITCHES ──────────────────────────────────────────────────────────────────── # ─── LIGHT SWITCHES ────────────────────────────────────────────────────────────────────
# #
- type: image - type: custom:decluttering-card
entity: light.pc template: floorplan_state_icon
tap_action: variables:
action: toggle - entity: light.pc
image: /local/images/floorplan/transparent.png - top: 71%
style: - left: 77.8%
top: 71%
left: 77.8%
- type: image - type: custom:decluttering-card
entity: light.living_room_main_lights template: floorplan_state_icon
tap_action: variables:
action: toggle - entity: light.living_room_main_lights
image: /local/images/floorplan/transparent.png - top: 69.8%
style: - left: 64.8%
top: 69.8%
left: 64.8%
width: 6%
height: 2%
- type: image - type: custom:decluttering-card
entity: light.master_bedroom_main_lights template: floorplan_state_icon
tap_action: variables:
action: toggle - entity: light.master_bedroom_main_lights
image: /local/images/floorplan/transparent.png - top: 25%
style: - left: 69.5%
top: 25%
left: 69.5%
width: 6%
height: 2%
- type: image - type: custom:decluttering-card
entity: light.bedside_light template: floorplan_state_icon
tap_action: variables:
action: toggle - entity: light.bedside_light
image: /local/images/floorplan/transparent.png - top: 11.7%
style: - left: 61.6%
top: 11.7%
left: 61.6%
width: 1.5%
- type: image - type: custom:decluttering-card
entity: light.tuya_kitchen_secondary_lights template: floorplan_state_icon
tap_action: variables:
action: toggle - entity: light.tuya_kitchen_secondary_lights
image: /local/images/floorplan/transparent.png - top: 28%
style: - left: 12.9%
top: 28%
left: 12.9%
width: 2%
- type: image - type: custom:decluttering-card
entity: light.tuya_kitchen_main_lights template: floorplan_state_icon
tap_action: variables:
action: toggle - entity: light.tuya_kitchen_main_lights
image: /local/images/floorplan/transparent.png - top: 29%
style: - left: 20.3%
top: 29%
left: 20.3%
width: 3.2%
- type: image - type: custom:decluttering-card
entity: light.tuya_hallway_entrance_lights template: floorplan_state_icon
tap_action: variables:
action: toggle - entity: light.tuya_hallway_entrance_lights
image: /local/images/floorplan/transparent.png - top: 26%
style: - left: 50.2%
top: 26%
left: 50.2%
- type: image - type: custom:decluttering-card
entity: light.tuya_hallway_main_lights template: floorplan_state_icon
tap_action: variables:
action: toggle - entity: light.tuya_hallway_main_lights
image: /local/images/floorplan/transparent.png - top: 41%
style: - left: 34.8%
top: 41%
left: 34.8%
width: 4%
height: 2%
# #
# ─── SENSORS ─────────────────────────────────────────────────────────────────────────── # ─── SENSORS ───────────────────────────────────────────────────────────────────────────
@@ -357,27 +332,31 @@ views:
# Living room ─────────────────────────────────────────────────────────────────────────── # Living room ───────────────────────────────────────────────────────────────────────────
- type: state-icon - type: custom:decluttering-card
entity: binary_sensor.titanium template: floorplan_state_icon
tap_action: variables:
- entity: binary_sensor.titanium
- top: 62%
- left: 80%
- tap_action:
action: call-service action: call-service
service: script.titanium_start service: script.titanium_start
style:
display: flex - type: custom:decluttering-card
align-items: center template: floorplan_state_icon
justify-content: center variables:
top: 62% - entity: sensor.synology_dsm_type_volume_1
left: 80% - top: 54%
width: 35px - left: 75%
height: 35px - tap_action:
border-radius: 50% action: more-info
background-color: "#fff"
box-shadow: 0 0 5px rgba(0, 0, 0, 0.6) - type: custom:decluttering-card
--divider-color: rgba(255, 255, 255, 0.4) template: floorplan_state_icon
--paper-item-icon-color: rgba(50, 50, 50, 0.8) variables:
--paper-item-icon-active-color: "#007cd6" - entity: media_player.nvidia_shield
--iron-icon-width: 18px - top: 54%
--iron-icon-height: 18px - left: 60%
- type: conditional - type: conditional
conditions: conditions:
@@ -399,27 +378,12 @@ views:
# Master Bedroom ──────────────────────────────────────────────────────────────────────── # Master Bedroom ────────────────────────────────────────────────────────────────────────
# Puifier # Puifier
- type: state-icon - type: custom:decluttering-card
entity: fan.philips_airpurifier template: floorplan_state_icon
icon: mdi:air-filter variables:
tap_action: - entity: fan.philips_airpurifier
action: toggle - top: 44.5%
style: - left: 62%
display: flex
align-items: center
justify-content: center
top: 44.5%
left: 62%
width: 35px
height: 35px
border-radius: 50%
background-color: "#fff"
box-shadow: 0 0 5px rgba(0, 0, 0, 0.6)
--divider-color: rgba(255, 255, 255, 0.4)
--paper-item-icon-color: rgba(50, 50, 50, 0.8)
--paper-item-icon-active-color: "#007cd6"
--iron-icon-width: 18px
--iron-icon-height: 18px
# Window # Window
- type: conditional - type: conditional
@@ -0,0 +1,24 @@
floorplan_state_icon:
default:
- tap_action:
action: toggle
element:
type: state-icon
entity: "[[entity]]"
tap_action: "[[tap_action]]"
style:
top: "[[top]]"
left: "[[left]]"
display: flex
align-items: center
justify-content: center
width: 35px
height: 35px
border-radius: 50%
background-color: "#fff"
box-shadow: 0 0 5px rgba(0, 0, 0, 0.6)
--divider-color: rgba(255, 255, 255, 0.4)
--paper-item-icon-color: rgba(50, 50, 50, 0.8)
--paper-item-icon-active-color: "#007cd6"
--iron-icon-width: 18px
--iron-icon-height: 18px