From 4d2558cb695f504ba5815ff06ae21dea633a1897 Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Sat, 7 May 2022 11:15:01 +0300 Subject: [PATCH] and shorthand --- .../automation/light_on_set_temperature.yaml | 3 +- config/packages/devices/bedroom/purifier.yaml | 12 +++----- .../devices/living_room/magic_cube.yaml | 18 ++++------- .../devices/living_room/toshiba_ac.yaml | 3 +- .../packages/modules/climate/radiators.yaml | 30 +++++++++---------- config/packages/modules/clock.yaml | 3 +- .../modules/lighting/areas/bedroom.yaml | 3 +- config/packages/modules/security.yaml | 3 +- config/packages/routines/coming_home.yaml | 22 +++++++------- config/packages/routines/waking_up.yaml | 15 +++++----- 10 files changed, 46 insertions(+), 66 deletions(-) diff --git a/config/blueprints/automation/light_on_set_temperature.yaml b/config/blueprints/automation/light_on_set_temperature.yaml index 48bba19..4e90951 100644 --- a/config/blueprints/automation/light_on_set_temperature.yaml +++ b/config/blueprints/automation/light_on_set_temperature.yaml @@ -34,8 +34,7 @@ action: color_temp: !input day_temp - conditions: - condition: and - conditions: + and: - condition: sun after: sunset - condition: not diff --git a/config/packages/devices/bedroom/purifier.yaml b/config/packages/devices/bedroom/purifier.yaml index b60787c..1755b0a 100644 --- a/config/packages/devices/bedroom/purifier.yaml +++ b/config/packages/devices/bedroom/purifier.yaml @@ -255,8 +255,7 @@ automation: entity_id: sensor.bedroom_weather_humidity below: 20 condition: - condition: and - conditions: + and: - condition: state entity_id: binary_sensor.purifier_out_of_water state: "off" @@ -288,8 +287,7 @@ automation: entity_id: sensor.purifier_air_quality above: 30 condition: - condition: and - conditions: + and: - condition: state entity_id: input_boolean.someone_home state: "on" @@ -331,8 +329,7 @@ automation: entity_id: sensor.bedroom_weather_humidity above: 55 condition: - condition: and - conditions: + and: - condition: state entity_id: fan.philips_airpurifier state: "on" @@ -360,8 +357,7 @@ automation: entity_id: sensor.purifier_air_quality below: 20 condition: - condition: and - conditions: + and: - condition: state entity_id: fan.philips_airpurifier state: "on" diff --git a/config/packages/devices/living_room/magic_cube.yaml b/config/packages/devices/living_room/magic_cube.yaml index 8f32870..cb4b14f 100644 --- a/config/packages/devices/living_room/magic_cube.yaml +++ b/config/packages/devices/living_room/magic_cube.yaml @@ -42,8 +42,7 @@ automation: device_ieee: !secret magic_cube_ieee command: knock condition: - condition: and - conditions: + and: - condition: state entity_id: input_boolean.magic_cube_enabled state: "on" @@ -62,8 +61,7 @@ automation: device_ieee: !secret magic_cube_ieee command: rotate_left condition: - condition: and - conditions: + and: - condition: state entity_id: input_boolean.magic_cube_enabled state: "on" @@ -84,8 +82,7 @@ automation: device_ieee: !secret magic_cube_ieee command: rotate_right condition: - condition: and - conditions: + and: - condition: state entity_id: input_boolean.magic_cube_enabled state: "on" @@ -107,8 +104,7 @@ automation: device_ieee: !secret magic_cube_ieee command: knock condition: - condition: and - conditions: + and: - condition: state entity_id: input_boolean.magic_cube_enabled state: "on" @@ -127,8 +123,7 @@ automation: device_ieee: !secret magic_cube_ieee command: rotate_left condition: - condition: and - conditions: + and: - condition: state entity_id: input_boolean.magic_cube_enabled state: "on" @@ -147,8 +142,7 @@ automation: device_ieee: !secret magic_cube_ieee command: rotate_right condition: - condition: and - conditions: + and: - condition: state entity_id: input_boolean.magic_cube_enabled state: "on" diff --git a/config/packages/devices/living_room/toshiba_ac.yaml b/config/packages/devices/living_room/toshiba_ac.yaml index 33b9f61..28cced6 100644 --- a/config/packages/devices/living_room/toshiba_ac.yaml +++ b/config/packages/devices/living_room/toshiba_ac.yaml @@ -120,8 +120,7 @@ script: toshiba_ac_on_cool_if_hot: sequence: - - condition: and - conditions: + - and: - "{{ states('sensor.multisensor_6_temperature')|float > states('input_number.toshiba_trigger_temp')|float }}" - condition: numeric_state entity_id: sensor.dark_sky_apparent_temperature diff --git a/config/packages/modules/climate/radiators.yaml b/config/packages/modules/climate/radiators.yaml index 161f973..757acdf 100644 --- a/config/packages/modules/climate/radiators.yaml +++ b/config/packages/modules/climate/radiators.yaml @@ -24,14 +24,13 @@ script: maybe_turn_radiator_on: alias: Climate · Heating · Maybe turn radiator on sequence: - - condition: and - conditions: - - condition: state - entity_id: input_boolean.heating_enabled - state: "on" - - condition: state - entity_id: binary_sensor.someone_home - state: "on" + - and: + - condition: state + entity_id: input_boolean.heating_enabled + state: "on" + - condition: state + entity_id: binary_sensor.someone_home + state: "on" - service: climate.turn_on data_template: entity_id: "{{ entity_id }}" @@ -57,14 +56,13 @@ script: turn_on_all_radiators: alias: Climate · Heating · Turn on all radiators sequence: - - condition: and - conditions: - - condition: state - entity_id: input_boolean.heating_enabled - state: "on" - - condition: state - entity_id: binary_sensor.someone_home - state: "on" + - and: + - condition: state + entity_id: input_boolean.heating_enabled + state: "on" + - condition: state + entity_id: binary_sensor.someone_home + state: "on" - service: script.maybe_turn_radiator_on data: entity_id: climate.living_room_radiator_mode diff --git a/config/packages/modules/clock.yaml b/config/packages/modules/clock.yaml index f3f4633..a9dca11 100644 --- a/config/packages/modules/clock.yaml +++ b/config/packages/modules/clock.yaml @@ -16,8 +16,7 @@ automation: platform: template value_template: "{{ states('sensor.time') == states('input_datetime.alarm_time')[0:5] }}" condition: - condition: and - conditions: + and: - condition: state entity_id: input_boolean.alarm_enabled state: "on" diff --git a/config/packages/modules/lighting/areas/bedroom.yaml b/config/packages/modules/lighting/areas/bedroom.yaml index 136e544..713d8e3 100644 --- a/config/packages/modules/lighting/areas/bedroom.yaml +++ b/config/packages/modules/lighting/areas/bedroom.yaml @@ -129,8 +129,7 @@ automation: entity_id: binary_sensor.bedroom_door to: "on" condition: - condition: and - conditions: + and: - condition: sun after: sunset after_offset: "-02:00:00" diff --git a/config/packages/modules/security.yaml b/config/packages/modules/security.yaml index d0da63f..c08bc41 100644 --- a/config/packages/modules/security.yaml +++ b/config/packages/modules/security.yaml @@ -52,8 +52,7 @@ automation: entity_id: binary_sensor.front_door to: "on" condition: - condition: and - conditions: + and: - condition: state entity_id: person.georgi state: "not_home" diff --git a/config/packages/routines/coming_home.yaml b/config/packages/routines/coming_home.yaml index 5873077..295941a 100644 --- a/config/packages/routines/coming_home.yaml +++ b/config/packages/routines/coming_home.yaml @@ -46,12 +46,11 @@ script: routine_coming_home_during_daytime: alias: Routine · Coming home · During daytime sequence: - - condition: and - conditions: - - condition: sun - after: sunrise - - condition: sun - before: sunset + - and: + - condition: sun + after: sunrise + - condition: sun + before: sunset - service: script.open_living_room_cover routine_coming_home_after_sunset: @@ -89,12 +88,11 @@ script: timeout: 00:02:00 - delay: 00:00:01 - - condition: and - conditions: - - condition: time - before: "23:00:00" - - condition: time - after: "9:00:00" + - and: + - condition: time + before: "23:00:00" + - condition: time + after: "9:00:00" - service: script.say data_template: diff --git a/config/packages/routines/waking_up.yaml b/config/packages/routines/waking_up.yaml index 1c9757b..0ef2b8f 100644 --- a/config/packages/routines/waking_up.yaml +++ b/config/packages/routines/waking_up.yaml @@ -15,14 +15,13 @@ script: - service: script.shield_screensaver # Only when no guests are present - - condition: and - conditions: - - condition: state - entity_id: input_boolean.guest_mode - state: "off" - - condition: state - entity_id: input_boolean.guest_bedroom - state: "off" + - and: + - condition: state + entity_id: input_boolean.guest_mode + state: "off" + - condition: state + entity_id: input_boolean.guest_bedroom + state: "off" - wait_template: "{{ is_state('input_boolean.sarah_talking', 'off') }}" timeout: 00:02:00 - delay: 00:00:0