From eac9cb9d72a95ca76549832a1c30300002c0a20e Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Sun, 10 Oct 2021 20:00:08 +0300 Subject: [PATCH] Minor improvements --- .../v3/primitives/v3_button.yaml | 2 +- .../v3/primitives/v3_pill.yaml | 2 +- .../v3/primitives/v3_popup_button.yaml | 6 ++ .../cards/brita_card.yaml | 12 ++- .../cards/living_room_climate_card.yaml | 10 --- .../cards/temperature_card.yaml | 18 ----- .../decluttering_templates/media_player.yaml | 18 ----- .../media_with_controls.yaml | 77 ------------------- .../v3/v3_media_with_controls.yaml | 24 ++---- config/lovelace/popup_cards.yaml | 64 ++++++++------- 10 files changed, 55 insertions(+), 178 deletions(-) create mode 100644 config/lovelace/button_card_templates/v3/primitives/v3_popup_button.yaml delete mode 100644 config/lovelace/decluttering_templates/cards/living_room_climate_card.yaml delete mode 100644 config/lovelace/decluttering_templates/cards/temperature_card.yaml delete mode 100644 config/lovelace/decluttering_templates/media_with_controls.yaml diff --git a/config/lovelace/button_card_templates/v3/primitives/v3_button.yaml b/config/lovelace/button_card_templates/v3/primitives/v3_button.yaml index 17e7c53..60e1651 100644 --- a/config/lovelace/button_card_templates/v3/primitives/v3_button.yaml +++ b/config/lovelace/button_card_templates/v3/primitives/v3_button.yaml @@ -34,7 +34,7 @@ v3_button: name: - position: absolute - left: 16px - - bottom: 28px + - bottom: "[[[ return this.___config.show_state ? '28px' : '10px'; ]]]" - white-space: normal - word-wrap: break-word - word-break: break-word diff --git a/config/lovelace/button_card_templates/v3/primitives/v3_pill.yaml b/config/lovelace/button_card_templates/v3/primitives/v3_pill.yaml index a448d7d..06e3595 100644 --- a/config/lovelace/button_card_templates/v3/primitives/v3_pill.yaml +++ b/config/lovelace/button_card_templates/v3/primitives/v3_pill.yaml @@ -8,7 +8,7 @@ v3_pill: styles: card: - width: 380px - - margin-left: 16px + - margin-left: 8px - height: 60px - font-size: 15px - border-radius: 8px diff --git a/config/lovelace/button_card_templates/v3/primitives/v3_popup_button.yaml b/config/lovelace/button_card_templates/v3/primitives/v3_popup_button.yaml new file mode 100644 index 0000000..2b2fcf3 --- /dev/null +++ b/config/lovelace/button_card_templates/v3/primitives/v3_popup_button.yaml @@ -0,0 +1,6 @@ +v3_popup_button: + variables: + background_color: rgba(60, 60, 60, 1) + styles: + card: + - margin-bottom: 8px diff --git a/config/lovelace/decluttering_templates/cards/brita_card.yaml b/config/lovelace/decluttering_templates/cards/brita_card.yaml index e9a75d2..b69014e 100644 --- a/config/lovelace/decluttering_templates/cards/brita_card.yaml +++ b/config/lovelace/decluttering_templates/cards/brita_card.yaml @@ -10,18 +10,24 @@ brita_card: - type: horizontal-stack cards: - type: custom:button-card - template: default + template: [v3_button, v3_popup_button] name: New filter entity: script.brita_new_filter + show_state: false tap_action: action: toggle + styles: + card: + - margin-left: 8px + - type: custom:button-card - template: default + template: [v3_button, v3_popup_button] name: Pour water entity: script.brita_pour_water + show_state: false tap_action: action: toggle - type: custom:button-card - template: default + template: [v3_button, v3_popup_button] name: Filter entity: binary_sensor.brita_should_change_filter diff --git a/config/lovelace/decluttering_templates/cards/living_room_climate_card.yaml b/config/lovelace/decluttering_templates/cards/living_room_climate_card.yaml deleted file mode 100644 index e61aa72..0000000 --- a/config/lovelace/decluttering_templates/cards/living_room_climate_card.yaml +++ /dev/null @@ -1,10 +0,0 @@ -living_room_climate_card: - card: - type: custom:decluttering-card - template: climate_card - variables: - - main_entity: sensor.multisensor_6_temperature - - left_entity: sensor.multisensor_6_relative_humidity - - left_name: Humidity (6) - - right_entity: sensor.multisensor_6_luminance - - right_name: Luminance (6) diff --git a/config/lovelace/decluttering_templates/cards/temperature_card.yaml b/config/lovelace/decluttering_templates/cards/temperature_card.yaml deleted file mode 100644 index 8a77e94..0000000 --- a/config/lovelace/decluttering_templates/cards/temperature_card.yaml +++ /dev/null @@ -1,18 +0,0 @@ -temperature_card: - default: - - main_name: "Temperature" - card: - type: vertical-stack - cards: - - type: "custom:mini-graph-card" - name: "[[main_name]]" - entities: - - "[[main_entity]]" - cache: false - group_by: hour - hours_to_show: 72 - line_width: 2 - show: - average: true - extrema: true - fill: true diff --git a/config/lovelace/decluttering_templates/media_player.yaml b/config/lovelace/decluttering_templates/media_player.yaml index b92305b..795f538 100644 --- a/config/lovelace/decluttering_templates/media_player.yaml +++ b/config/lovelace/decluttering_templates/media_player.yaml @@ -28,21 +28,3 @@ sonos_media_player: idle_view: when_idle: true when_standby: true - -sonos_media_player_small: - card: - type: custom:mini-media-player - artwork: cover - name: "[[name]]" - entity: "[[player]]" - speaker_group: - entities: *entities_in_gorup - hide: - power: true - icon: true - controls: true - shuffle: true - info: true - idle_view: - when_idle: true - when_standby: true diff --git a/config/lovelace/decluttering_templates/media_with_controls.yaml b/config/lovelace/decluttering_templates/media_with_controls.yaml deleted file mode 100644 index 9823495..0000000 --- a/config/lovelace/decluttering_templates/media_with_controls.yaml +++ /dev/null @@ -1,77 +0,0 @@ -media_with_controls: - default: - - title: "Media" - - player_name: - card: - type: vertical-stack - title: "[[title]]" - cards: - - type: custom:decluttering-card - template: sonos_media_player - variables: - - player: "[[player]]" - - name: "[[player_name]]" - - sync_volume: false - - type: horizontal-stack - cards: - - type: custom:button-card - template: xs - entity: script.sonos_volume_10 - icon: mdi:volume-low - name: vol 10 - tap_action: - action: call-service - service: script.sonos_volume_10 - - type: custom:button-card - template: xs - entity: script.sonos_volume_20 - icon: mdi:volume-medium - name: vol 20 - tap_action: - action: call-service - service: script.sonos_volume_20 - - type: custom:button-card - template: xs - entity: script.music_play - name: Chill - icon: mdi:music - tap_action: - action: toggle - - type: custom:button-card - template: xs - entity: script.music_play - name: Chill 2 - icon: mdi:music - tap_action: - action: call-service - service: script.music_play - service_data: - playlist: "Songs for a Romantic Evening" - shuffle: true - volume_level: 0.1 - - type: custom:button-card - template: xs - entity: script.music_play - name: Retro - icon: mdi:music - tap_action: - action: call-service - service: script.music_play - service_data: - playlist: "Retro" - - type: custom:button-card - template: [xs, with_state_background] - entity: binary_sensor.sonos_is_bedroom_master - name: Bedroom - icon: mdi:speaker-multiple - tap_action: - action: call-service - service: script.sonos_join_bedroom - - type: custom:button-card - template: [xs, with_state_background] - entity: binary_sensor.sonos_is_living_room_master - name: TV - icon: mdi:speaker-multiple - tap_action: - action: call-service - service: script.sonos_join_tv diff --git a/config/lovelace/decluttering_templates/v3/v3_media_with_controls.yaml b/config/lovelace/decluttering_templates/v3/v3_media_with_controls.yaml index b7dddbe..adbcd2e 100644 --- a/config/lovelace/decluttering_templates/v3/v3_media_with_controls.yaml +++ b/config/lovelace/decluttering_templates/v3/v3_media_with_controls.yaml @@ -20,11 +20,11 @@ v3_media_with_controls: template: v3_section_title variables: - title: Volume - - margin_left: 16px + - margin_left: 8px - type: horizontal-stack cards: - type: custom:button-card - template: v3_xs_button + template: [v3_xs_button, v3_popup_button] show_state: false entity: script.sonos_volume_10 icon: mdi:volume-medium @@ -34,11 +34,9 @@ v3_media_with_controls: service: script.sonos_volume_10 styles: card: - - margin-left: 16px - variables: - background_color: rgba(60, 60, 60, 1) + - margin-left: 8px - type: custom:button-card - template: v3_xs_button + template: [v3_xs_button, v3_popup_button] show_state: false entity: script.sonos_volume_20 icon: mdi:volume-high @@ -46,19 +44,17 @@ v3_media_with_controls: tap_action: action: call-service service: script.sonos_volume_20 - variables: - background_color: rgba(60, 60, 60, 1) - type: vertical-stack cards: - type: custom:decluttering-card template: v3_section_title variables: - title: Group - - margin_left: 16px + - margin_left: 8px - type: horizontal-stack cards: - type: custom:button-card - template: v3_xs_button + template: [v3_xs_button, v3_popup_button] entity: binary_sensor.sonos_is_bedroom_master name: Bedroom icon: mdi:speaker-multiple @@ -67,19 +63,15 @@ v3_media_with_controls: service: script.sonos_join_bedroom styles: card: - - margin-left: 16px - variables: - background_color: rgba(60, 60, 60, 1) + - margin-left: 8px - type: custom:button-card - template: v3_xs_button + template: [v3_xs_button, v3_popup_button] entity: binary_sensor.sonos_is_living_room_master name: TV icon: mdi:speaker-multiple tap_action: action: call-service service: script.sonos_join_tv - variables: - background_color: rgba(60, 60, 60, 1) - type: vertical-stack cards: - type: custom:decluttering-card diff --git a/config/lovelace/popup_cards.yaml b/config/lovelace/popup_cards.yaml index 8e432d9..567788b 100644 --- a/config/lovelace/popup_cards.yaml +++ b/config/lovelace/popup_cards.yaml @@ -163,38 +163,29 @@ sensor.active_motion_sensors: - type: horizontal-stack cards: - type: custom:button-card - template: v3_button + template: [v3_button, v3_popup_button] entity: binary_sensor.hallway_motion_occupancy name: Hallway Entrance styles: card: - margin-left: 8px - variables: - background_color: rgba(60, 60, 60, 1) - type: custom:button-card - template: v3_button + template: [v3_button, v3_popup_button] entity: binary_sensor.trisensor_motion name: Hallway - variables: - background_color: rgba(60, 60, 60, 1) - type: custom:button-card - template: v3_button + template: [v3_button, v3_popup_button] entity: binary_sensor.multisensor_motion name: Living Room - variables: - background_color: rgba(60, 60, 60, 1) - type: horizontal-stack cards: - type: custom:button-card - template: v3_button + template: [v3_button, v3_popup_button] entity: binary_sensor.kitchen_motion_occupancy name: Kitchen styles: card: - margin-left: 8px - - margin-bottom: 8px - variables: - background_color: rgba(60, 60, 60, 1) sensor.open_door_count: title: Open doors @@ -204,20 +195,15 @@ sensor.open_door_count: - type: horizontal-stack cards: - type: custom:button-card - template: v3_button + template: [v3_button, v3_popup_button] entity: binary_sensor.front_door styles: card: - margin-left: 8px - - margin-bottom: 8px - variables: - background_color: rgba(60, 60, 60, 1) - type: custom:button-card - template: v3_button + template: [v3_button, v3_popup_button] entity: binary_sensor.bedroom_door name: Bedroom - variables: - background_color: rgba(60, 60, 60, 1) sensor.open_window_count: title: Open windows @@ -227,38 +213,29 @@ sensor.open_window_count: - type: horizontal-stack cards: - type: custom:button-card - template: v3_button + template: [v3_button, v3_popup_button] entity: binary_sensor.living_room_right_window name: Living Room styles: card: - margin-left: 8px - variables: - background_color: rgba(60, 60, 60, 1) - type: custom:button-card - template: v3_button + template: [v3_button, v3_popup_button] entity: binary_sensor.bedroom_left_window name: Bedroom Left - variables: - background_color: rgba(60, 60, 60, 1) - type: custom:button-card - template: v3_button + template: [v3_button, v3_popup_button] entity: binary_sensor.bedroom_right_window name: Bedroom Right - variables: - background_color: rgba(60, 60, 60, 1) - type: horizontal-stack cards: - type: custom:button-card - template: v3_button + template: [v3_button, v3_popup_button] entity: binary_sensor.kitchen_window name: Kitchen styles: card: - margin-left: 8px - - margin-bottom: 8px - variables: - background_color: rgba(60, 60, 60, 1) sensor.bedroom_weather_temperature: title: Bedroom Climate @@ -270,7 +247,26 @@ sensor.multisensor_6_temperature: title: Living Room Climate card: type: custom:decluttering-card - template: living_room_climate_card + template: climate_card + variables: + - main_entity: sensor.multisensor_6_temperature + - left_entity: sensor.multisensor_6_relative_humidity + - right_entity: sensor.multisensor_6_luminance + - right_name: Luminance + + +sensor.multisensor_6_relative_humidity: + title: Living Room Humidity + card: + type: custom:decluttering-card + template: climate_card + variables: + - main_entity: sensor.multisensor_6_relative_humidity + - main_name: Humidity + - left_entity: sensor.multisensor_6_temperature + - left_name: Temperature + - right_entity: sensor.multisensor_6_luminance + - right_name: Luminance sensor.bedroom_weather_humidity: title: Bedroom Humidity