From 6d627cdcdca404d896d4c9ac121dca75152eae1b Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 30 Mar 2022 06:36:19 +0000 Subject: [PATCH] Prettify yaml (test fixtures) --- tests/components/bayesian/fixtures/configuration.yaml | 6 +++--- tests/components/modbus/fixtures/configuration.yaml | 1 - .../rest/fixtures/configuration_top_level.yaml | 1 - .../template/fixtures/broken_configuration.yaml | 9 +++++---- .../template/fixtures/empty_configuration.yaml | 1 - .../template/fixtures/sensor_configuration.yaml | 10 ++++++---- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/components/bayesian/fixtures/configuration.yaml b/tests/components/bayesian/fixtures/configuration.yaml index 56a490d4aec35d..099350eaa78821 100644 --- a/tests/components/bayesian/fixtures/configuration.yaml +++ b/tests/components/bayesian/fixtures/configuration.yaml @@ -2,9 +2,9 @@ binary_sensor: - platform: bayesian prior: 0.1 observations: - - entity_id: 'switch.kitchen_lights' + - entity_id: "switch.kitchen_lights" prob_given_true: 0.6 prob_given_false: 0.2 - platform: 'state' - to_state: 'on' + platform: "state" + to_state: "on" name: test2 diff --git a/tests/components/modbus/fixtures/configuration.yaml b/tests/components/modbus/fixtures/configuration.yaml index 0a2f46b315142e..0f12ac886860b8 100644 --- a/tests/components/modbus/fixtures/configuration.yaml +++ b/tests/components/modbus/fixtures/configuration.yaml @@ -3,4 +3,3 @@ modbus: host: "testHost" port: 5001 name: "testModbus" - diff --git a/tests/components/rest/fixtures/configuration_top_level.yaml b/tests/components/rest/fixtures/configuration_top_level.yaml index df27e1601176f5..b141dd0b176afa 100644 --- a/tests/components/rest/fixtures/configuration_top_level.yaml +++ b/tests/components/rest/fixtures/configuration_top_level.yaml @@ -9,4 +9,3 @@ sensor: resource: "http://localhost" method: GET name: rollout - diff --git a/tests/components/template/fixtures/broken_configuration.yaml b/tests/components/template/fixtures/broken_configuration.yaml index 9d21081ac8730b..de0c8aebd9d50d 100644 --- a/tests/components/template/fixtures/broken_configuration.yaml +++ b/tests/components/template/fixtures/broken_configuration.yaml @@ -6,11 +6,12 @@ sensor: combined_sensor_energy_usage: friendly_name: Combined Sense Energy Usage unit_of_measurement: kW - value_template: '{{ ((states(''sensor.energy_usage'') | float) + (states(''sensor.energy_usage_2'') - | float)) / 1000 }}' + value_template: + "{{ ((states('sensor.energy_usage') | float) + (states('sensor.energy_usage_2') + | float)) / 1000 }}" watching_tv_in_master_bedroom: friendly_name: Watching TV in Master Bedroom - value_template: '{% if state_attr("remote.alexander_master_bedroom","current_activity") + value_template: + '{% if state_attr("remote.alexander_master_bedroom","current_activity") == "Watch TV" or state_attr("remote.alexander_master_bedroom","current_activity") == "Watch Apple TV" %}on{% else %}off{% endif %}' - diff --git a/tests/components/template/fixtures/empty_configuration.yaml b/tests/components/template/fixtures/empty_configuration.yaml index 8b137891791fe9..e69de29bb2d1d6 100644 --- a/tests/components/template/fixtures/empty_configuration.yaml +++ b/tests/components/template/fixtures/empty_configuration.yaml @@ -1 +0,0 @@ - diff --git a/tests/components/template/fixtures/sensor_configuration.yaml b/tests/components/template/fixtures/sensor_configuration.yaml index 8fb2ae9564fad0..02c8cc373f4877 100644 --- a/tests/components/template/fixtures/sensor_configuration.yaml +++ b/tests/components/template/fixtures/sensor_configuration.yaml @@ -6,18 +6,20 @@ sensor: host: 192.168.210.25 community: public accept_errors: true - value_template: '{{ ((value | int) / 1000) | float | round(3) }}' + value_template: "{{ ((value | int) / 1000) | float | round(3) }}" scan_interval: 900 - platform: template sensors: combined_sensor_energy_usage: friendly_name: Combined Sense Energy Usage unit_of_measurement: kW - value_template: '{{ ((states(''sensor.energy_usage'') | float) + (states(''sensor.energy_usage_2'') - | float)) / 1000 }}' + value_template: + "{{ ((states('sensor.energy_usage') | float) + (states('sensor.energy_usage_2') + | float)) / 1000 }}" watching_tv_in_master_bedroom: friendly_name: Watching TV in Master Bedroom - value_template: '{% if state_attr("remote.alexander_master_bedroom","current_activity") + value_template: + '{% if state_attr("remote.alexander_master_bedroom","current_activity") == "Watch TV" or state_attr("remote.alexander_master_bedroom","current_activity") == "Watch Apple TV" %}on{% else %}off{% endif %}'