From 162f5ccbde52e56148ad5e5497afc7998328bbd2 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Thu, 23 May 2024 16:29:39 +0200 Subject: [PATCH] Add snapshot platform tests to rainmachine (#117978) * Add snapshot tests to rainmachine * Add sensor and switch tests --- .../snapshots/test_binary_sensor.ambr | 277 +++ .../rainmachine/snapshots/test_button.ambr | 48 + .../rainmachine/snapshots/test_select.ambr | 60 + .../rainmachine/snapshots/test_sensor.ambr | 707 ++++++++ .../rainmachine/snapshots/test_switch.ambr | 1615 +++++++++++++++++ .../rainmachine/test_binary_sensor.py | 36 + tests/components/rainmachine/test_button.py | 32 + tests/components/rainmachine/test_select.py | 32 + tests/components/rainmachine/test_sensor.py | 34 + tests/components/rainmachine/test_switch.py | 34 + 10 files changed, 2875 insertions(+) create mode 100644 tests/components/rainmachine/snapshots/test_binary_sensor.ambr create mode 100644 tests/components/rainmachine/snapshots/test_button.ambr create mode 100644 tests/components/rainmachine/snapshots/test_select.ambr create mode 100644 tests/components/rainmachine/snapshots/test_sensor.ambr create mode 100644 tests/components/rainmachine/snapshots/test_switch.ambr create mode 100644 tests/components/rainmachine/test_binary_sensor.py create mode 100644 tests/components/rainmachine/test_button.py create mode 100644 tests/components/rainmachine/test_select.py create mode 100644 tests/components/rainmachine/test_sensor.py create mode 100644 tests/components/rainmachine/test_switch.py diff --git a/tests/components/rainmachine/snapshots/test_binary_sensor.ambr b/tests/components/rainmachine/snapshots/test_binary_sensor.ambr new file mode 100644 index 00000000000..9c930736fe3 --- /dev/null +++ b/tests/components/rainmachine/snapshots/test_binary_sensor.ambr @@ -0,0 +1,277 @@ +# serializer version: 1 +# name: test_binary_sensors[binary_sensor.12345_freeze_restrictions-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'binary_sensor', + 'entity_category': , + 'entity_id': 'binary_sensor.12345_freeze_restrictions', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Freeze restrictions', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'freeze', + 'unique_id': 'aa:bb:cc:dd:ee:ff_freeze', + 'unit_of_measurement': None, + }) +# --- +# name: test_binary_sensors[binary_sensor.12345_freeze_restrictions-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': '12345 Freeze restrictions', + }), + 'context': , + 'entity_id': 'binary_sensor.12345_freeze_restrictions', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_binary_sensors[binary_sensor.12345_hourly_restrictions-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'binary_sensor', + 'entity_category': , + 'entity_id': 'binary_sensor.12345_hourly_restrictions', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Hourly restrictions', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'hourly', + 'unique_id': 'aa:bb:cc:dd:ee:ff_hourly', + 'unit_of_measurement': None, + }) +# --- +# name: test_binary_sensors[binary_sensor.12345_hourly_restrictions-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': '12345 Hourly restrictions', + }), + 'context': , + 'entity_id': 'binary_sensor.12345_hourly_restrictions', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_binary_sensors[binary_sensor.12345_month_restrictions-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'binary_sensor', + 'entity_category': , + 'entity_id': 'binary_sensor.12345_month_restrictions', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Month restrictions', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'month', + 'unique_id': 'aa:bb:cc:dd:ee:ff_month', + 'unit_of_measurement': None, + }) +# --- +# name: test_binary_sensors[binary_sensor.12345_month_restrictions-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': '12345 Month restrictions', + }), + 'context': , + 'entity_id': 'binary_sensor.12345_month_restrictions', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_binary_sensors[binary_sensor.12345_rain_delay_restrictions-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'binary_sensor', + 'entity_category': , + 'entity_id': 'binary_sensor.12345_rain_delay_restrictions', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Rain delay restrictions', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'raindelay', + 'unique_id': 'aa:bb:cc:dd:ee:ff_raindelay', + 'unit_of_measurement': None, + }) +# --- +# name: test_binary_sensors[binary_sensor.12345_rain_delay_restrictions-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': '12345 Rain delay restrictions', + }), + 'context': , + 'entity_id': 'binary_sensor.12345_rain_delay_restrictions', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_binary_sensors[binary_sensor.12345_rain_sensor_restrictions-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'binary_sensor', + 'entity_category': , + 'entity_id': 'binary_sensor.12345_rain_sensor_restrictions', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Rain sensor restrictions', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'rainsensor', + 'unique_id': 'aa:bb:cc:dd:ee:ff_rainsensor', + 'unit_of_measurement': None, + }) +# --- +# name: test_binary_sensors[binary_sensor.12345_rain_sensor_restrictions-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': '12345 Rain sensor restrictions', + }), + 'context': , + 'entity_id': 'binary_sensor.12345_rain_sensor_restrictions', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_binary_sensors[binary_sensor.12345_weekday_restrictions-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'binary_sensor', + 'entity_category': , + 'entity_id': 'binary_sensor.12345_weekday_restrictions', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Weekday restrictions', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'weekday', + 'unique_id': 'aa:bb:cc:dd:ee:ff_weekday', + 'unit_of_measurement': None, + }) +# --- +# name: test_binary_sensors[binary_sensor.12345_weekday_restrictions-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': '12345 Weekday restrictions', + }), + 'context': , + 'entity_id': 'binary_sensor.12345_weekday_restrictions', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- diff --git a/tests/components/rainmachine/snapshots/test_button.ambr b/tests/components/rainmachine/snapshots/test_button.ambr new file mode 100644 index 00000000000..609079bb0d8 --- /dev/null +++ b/tests/components/rainmachine/snapshots/test_button.ambr @@ -0,0 +1,48 @@ +# serializer version: 1 +# name: test_buttons[button.12345_restart-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'button', + 'entity_category': , + 'entity_id': 'button.12345_restart', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Restart', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_reboot', + 'unit_of_measurement': None, + }) +# --- +# name: test_buttons[button.12345_restart-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'restart', + 'friendly_name': '12345 Restart', + }), + 'context': , + 'entity_id': 'button.12345_restart', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- diff --git a/tests/components/rainmachine/snapshots/test_select.ambr b/tests/components/rainmachine/snapshots/test_select.ambr new file mode 100644 index 00000000000..651a709d2fa --- /dev/null +++ b/tests/components/rainmachine/snapshots/test_select.ambr @@ -0,0 +1,60 @@ +# serializer version: 1 +# name: test_select_entities[select.12345_freeze_protection_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'options': list([ + '0°C', + '2°C', + '5°C', + '10°C', + ]), + }), + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'select', + 'entity_category': , + 'entity_id': 'select.12345_freeze_protection_temperature', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': None, + 'original_name': 'Freeze protection temperature', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'freeze_protection_temperature', + 'unique_id': 'aa:bb:cc:dd:ee:ff_freeze_protection_temperature', + 'unit_of_measurement': None, + }) +# --- +# name: test_select_entities[select.12345_freeze_protection_temperature-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': '12345 Freeze protection temperature', + 'options': list([ + '0°C', + '2°C', + '5°C', + '10°C', + ]), + }), + 'context': , + 'entity_id': 'select.12345_freeze_protection_temperature', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '2°C', + }) +# --- diff --git a/tests/components/rainmachine/snapshots/test_sensor.ambr b/tests/components/rainmachine/snapshots/test_sensor.ambr new file mode 100644 index 00000000000..e93d0645030 --- /dev/null +++ b/tests/components/rainmachine/snapshots/test_sensor.ambr @@ -0,0 +1,707 @@ +# serializer version: 1 +# name: test_sensors[sensor.12345_evening_run_completion_time-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.12345_evening_run_completion_time', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Evening Run Completion Time', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_program_run_completion_time_2', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensors[sensor.12345_evening_run_completion_time-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'timestamp', + 'friendly_name': '12345 Evening Run Completion Time', + }), + 'context': , + 'entity_id': 'sensor.12345_evening_run_completion_time', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_sensors[sensor.12345_flower_box_run_completion_time-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.12345_flower_box_run_completion_time', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Flower Box Run Completion Time', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_run_completion_time_2', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensors[sensor.12345_flower_box_run_completion_time-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'timestamp', + 'friendly_name': '12345 Flower Box Run Completion Time', + }), + 'context': , + 'entity_id': 'sensor.12345_flower_box_run_completion_time', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_sensors[sensor.12345_landscaping_run_completion_time-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.12345_landscaping_run_completion_time', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Landscaping Run Completion Time', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_run_completion_time_1', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensors[sensor.12345_landscaping_run_completion_time-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'timestamp', + 'friendly_name': '12345 Landscaping Run Completion Time', + }), + 'context': , + 'entity_id': 'sensor.12345_landscaping_run_completion_time', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_sensors[sensor.12345_morning_run_completion_time-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.12345_morning_run_completion_time', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Morning Run Completion Time', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_program_run_completion_time_1', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensors[sensor.12345_morning_run_completion_time-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'timestamp', + 'friendly_name': '12345 Morning Run Completion Time', + }), + 'context': , + 'entity_id': 'sensor.12345_morning_run_completion_time', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_sensors[sensor.12345_rain_sensor_rain_start-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.12345_rain_sensor_rain_start', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': 'mdi:weather-pouring', + 'original_name': 'Rain sensor rain start', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'rain_sensor_rain_start', + 'unique_id': 'aa:bb:cc:dd:ee:ff_rain_sensor_rain_start', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensors[sensor.12345_rain_sensor_rain_start-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'timestamp', + 'friendly_name': '12345 Rain sensor rain start', + 'icon': 'mdi:weather-pouring', + }), + 'context': , + 'entity_id': 'sensor.12345_rain_sensor_rain_start', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_sensors[sensor.12345_test_run_completion_time-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.12345_test_run_completion_time', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'TEST Run Completion Time', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_run_completion_time_3', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensors[sensor.12345_test_run_completion_time-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'timestamp', + 'friendly_name': '12345 TEST Run Completion Time', + }), + 'context': , + 'entity_id': 'sensor.12345_test_run_completion_time', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_sensors[sensor.12345_zone_10_run_completion_time-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.12345_zone_10_run_completion_time', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Zone 10 Run Completion Time', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_run_completion_time_10', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensors[sensor.12345_zone_10_run_completion_time-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'timestamp', + 'friendly_name': '12345 Zone 10 Run Completion Time', + }), + 'context': , + 'entity_id': 'sensor.12345_zone_10_run_completion_time', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_sensors[sensor.12345_zone_11_run_completion_time-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.12345_zone_11_run_completion_time', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Zone 11 Run Completion Time', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_run_completion_time_11', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensors[sensor.12345_zone_11_run_completion_time-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'timestamp', + 'friendly_name': '12345 Zone 11 Run Completion Time', + }), + 'context': , + 'entity_id': 'sensor.12345_zone_11_run_completion_time', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_sensors[sensor.12345_zone_12_run_completion_time-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.12345_zone_12_run_completion_time', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Zone 12 Run Completion Time', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_run_completion_time_12', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensors[sensor.12345_zone_12_run_completion_time-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'timestamp', + 'friendly_name': '12345 Zone 12 Run Completion Time', + }), + 'context': , + 'entity_id': 'sensor.12345_zone_12_run_completion_time', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_sensors[sensor.12345_zone_4_run_completion_time-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.12345_zone_4_run_completion_time', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Zone 4 Run Completion Time', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_run_completion_time_4', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensors[sensor.12345_zone_4_run_completion_time-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'timestamp', + 'friendly_name': '12345 Zone 4 Run Completion Time', + }), + 'context': , + 'entity_id': 'sensor.12345_zone_4_run_completion_time', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_sensors[sensor.12345_zone_5_run_completion_time-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.12345_zone_5_run_completion_time', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Zone 5 Run Completion Time', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_run_completion_time_5', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensors[sensor.12345_zone_5_run_completion_time-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'timestamp', + 'friendly_name': '12345 Zone 5 Run Completion Time', + }), + 'context': , + 'entity_id': 'sensor.12345_zone_5_run_completion_time', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_sensors[sensor.12345_zone_6_run_completion_time-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.12345_zone_6_run_completion_time', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Zone 6 Run Completion Time', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_run_completion_time_6', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensors[sensor.12345_zone_6_run_completion_time-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'timestamp', + 'friendly_name': '12345 Zone 6 Run Completion Time', + }), + 'context': , + 'entity_id': 'sensor.12345_zone_6_run_completion_time', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_sensors[sensor.12345_zone_7_run_completion_time-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.12345_zone_7_run_completion_time', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Zone 7 Run Completion Time', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_run_completion_time_7', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensors[sensor.12345_zone_7_run_completion_time-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'timestamp', + 'friendly_name': '12345 Zone 7 Run Completion Time', + }), + 'context': , + 'entity_id': 'sensor.12345_zone_7_run_completion_time', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_sensors[sensor.12345_zone_8_run_completion_time-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.12345_zone_8_run_completion_time', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Zone 8 Run Completion Time', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_run_completion_time_8', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensors[sensor.12345_zone_8_run_completion_time-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'timestamp', + 'friendly_name': '12345 Zone 8 Run Completion Time', + }), + 'context': , + 'entity_id': 'sensor.12345_zone_8_run_completion_time', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- +# name: test_sensors[sensor.12345_zone_9_run_completion_time-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.12345_zone_9_run_completion_time', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Zone 9 Run Completion Time', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_run_completion_time_9', + 'unit_of_measurement': None, + }) +# --- +# name: test_sensors[sensor.12345_zone_9_run_completion_time-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'timestamp', + 'friendly_name': '12345 Zone 9 Run Completion Time', + }), + 'context': , + 'entity_id': 'sensor.12345_zone_9_run_completion_time', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'unknown', + }) +# --- diff --git a/tests/components/rainmachine/snapshots/test_switch.ambr b/tests/components/rainmachine/snapshots/test_switch.ambr new file mode 100644 index 00000000000..f03a2e46711 --- /dev/null +++ b/tests/components/rainmachine/snapshots/test_switch.ambr @@ -0,0 +1,1615 @@ +# serializer version: 1 +# name: test_switches[switch.12345_evening-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': None, + 'entity_id': 'switch.12345_evening', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:water', + 'original_name': 'Evening', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_program_2', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_evening-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': '12345 Evening', + 'icon': 'mdi:water', + 'id': 2, + 'next_run': '2018-06-04T06:00:00', + 'soak': 0, + 'status': , + 'zones': list([ + dict({ + 'active': True, + 'duration': 0, + 'id': 1, + 'minRuntimeCoef': 1, + 'name': 'Landscaping', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': True, + 'duration': 0, + 'id': 2, + 'minRuntimeCoef': 1, + 'name': 'Flower Box', + 'order': -1, + 'userPercentage': 1, + }), + ]), + }), + 'context': , + 'entity_id': 'switch.12345_evening', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switches[switch.12345_evening_enabled-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.12345_evening_enabled', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:cog', + 'original_name': 'Evening enabled', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_program_2_enabled', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_evening_enabled-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': '12345 Evening enabled', + 'icon': 'mdi:cog', + }), + 'context': , + 'entity_id': 'switch.12345_evening_enabled', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switches[switch.12345_extra_water_on_hot_days-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.12345_extra_water_on_hot_days', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:heat-wave', + 'original_name': 'Extra water on hot days', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'hot_days_extra_watering', + 'unique_id': 'aa:bb:cc:dd:ee:ff_hot_days_extra_watering', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_extra_water_on_hot_days-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': '12345 Extra water on hot days', + 'icon': 'mdi:heat-wave', + }), + 'context': , + 'entity_id': 'switch.12345_extra_water_on_hot_days', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switches[switch.12345_flower_box-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': None, + 'entity_id': 'switch.12345_flower_box', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:water', + 'original_name': 'Flower box', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_2', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_flower_box-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'area': 92.9, + 'current_cycle': 0, + 'field_capacity': 0.17, + 'friendly_name': '12345 Flower box', + 'icon': 'mdi:water', + 'id': 2, + 'number_of_cycles': 0, + 'restrictions': False, + 'slope': 'Flat', + 'soil_type': 'Sandy Loam', + 'sprinkler_head_precipitation_rate': 12.7, + 'sprinkler_head_type': 'Surface Drip', + 'status': , + 'sun_exposure': 'Full Sun', + 'vegetation_type': 'Vegetables', + }), + 'context': , + 'entity_id': 'switch.12345_flower_box', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switches[switch.12345_flower_box_enabled-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.12345_flower_box_enabled', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:cog', + 'original_name': 'Flower box enabled', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_2_enabled', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_flower_box_enabled-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': '12345 Flower box enabled', + 'icon': 'mdi:cog', + }), + 'context': , + 'entity_id': 'switch.12345_flower_box_enabled', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_switches[switch.12345_freeze_protection-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.12345_freeze_protection', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:snowflake-alert', + 'original_name': 'Freeze protection', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': 'freeze_protect_enabled', + 'unique_id': 'aa:bb:cc:dd:ee:ff_freeze_protect_enabled', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_freeze_protection-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': '12345 Freeze protection', + 'icon': 'mdi:snowflake-alert', + }), + 'context': , + 'entity_id': 'switch.12345_freeze_protection', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_switches[switch.12345_landscaping-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': None, + 'entity_id': 'switch.12345_landscaping', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:water', + 'original_name': 'Landscaping', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_1', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_landscaping-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'area': 92.9, + 'current_cycle': 0, + 'field_capacity': 0.17, + 'friendly_name': '12345 Landscaping', + 'icon': 'mdi:water', + 'id': 1, + 'number_of_cycles': 0, + 'restrictions': False, + 'slope': 'Flat', + 'soil_type': 'Sandy Loam', + 'sprinkler_head_precipitation_rate': 25.4, + 'sprinkler_head_type': 'Bubblers Drip', + 'status': , + 'sun_exposure': 'Full Sun', + 'vegetation_type': 'Flowers', + }), + 'context': , + 'entity_id': 'switch.12345_landscaping', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switches[switch.12345_landscaping_enabled-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.12345_landscaping_enabled', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:cog', + 'original_name': 'Landscaping enabled', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_1_enabled', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_landscaping_enabled-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': '12345 Landscaping enabled', + 'icon': 'mdi:cog', + }), + 'context': , + 'entity_id': 'switch.12345_landscaping_enabled', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_switches[switch.12345_morning-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': None, + 'entity_id': 'switch.12345_morning', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:water', + 'original_name': 'Morning', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_program_1', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_morning-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': '12345 Morning', + 'icon': 'mdi:water', + 'id': 1, + 'next_run': '2018-06-04T06:00:00', + 'soak': 0, + 'status': , + 'zones': list([ + dict({ + 'active': True, + 'duration': 0, + 'id': 1, + 'minRuntimeCoef': 1, + 'name': 'Landscaping', + 'order': -1, + 'userPercentage': 1, + }), + dict({ + 'active': True, + 'duration': 0, + 'id': 2, + 'minRuntimeCoef': 1, + 'name': 'Flower Box', + 'order': -1, + 'userPercentage': 1, + }), + ]), + }), + 'context': , + 'entity_id': 'switch.12345_morning', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switches[switch.12345_morning_enabled-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.12345_morning_enabled', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:cog', + 'original_name': 'Morning enabled', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_program_1_enabled', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_morning_enabled-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': '12345 Morning enabled', + 'icon': 'mdi:cog', + }), + 'context': , + 'entity_id': 'switch.12345_morning_enabled', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'on', + }) +# --- +# name: test_switches[switch.12345_test-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': None, + 'entity_id': 'switch.12345_test', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:water', + 'original_name': 'Test', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_3', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_test-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'area': 92.9, + 'current_cycle': 0, + 'field_capacity': 0.3, + 'friendly_name': '12345 Test', + 'icon': 'mdi:water', + 'id': 3, + 'number_of_cycles': 0, + 'restrictions': False, + 'slope': 'Flat', + 'soil_type': 'Clay Loam', + 'sprinkler_head_precipitation_rate': 35.56, + 'sprinkler_head_type': 'Popup Spray', + 'status': , + 'sun_exposure': 'Full Sun', + 'vegetation_type': 'Drought Tolerant Plants', + }), + 'context': , + 'entity_id': 'switch.12345_test', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switches[switch.12345_test_enabled-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.12345_test_enabled', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:cog', + 'original_name': 'Test enabled', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_3_enabled', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_test_enabled-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': '12345 Test enabled', + 'icon': 'mdi:cog', + }), + 'context': , + 'entity_id': 'switch.12345_test_enabled', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switches[switch.12345_zone_10-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': None, + 'entity_id': 'switch.12345_zone_10', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:water', + 'original_name': 'Zone 10', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_10', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_zone_10-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'area': 92.9, + 'current_cycle': 0, + 'field_capacity': 0.3, + 'friendly_name': '12345 Zone 10', + 'icon': 'mdi:water', + 'id': 10, + 'number_of_cycles': 0, + 'restrictions': False, + 'slope': 'Flat', + 'soil_type': 'Clay Loam', + 'sprinkler_head_precipitation_rate': 35.56, + 'sprinkler_head_type': 'Popup Spray', + 'status': , + 'sun_exposure': 'Full Sun', + 'vegetation_type': 'Cool Season Grass', + }), + 'context': , + 'entity_id': 'switch.12345_zone_10', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switches[switch.12345_zone_10_enabled-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.12345_zone_10_enabled', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:cog', + 'original_name': 'Zone 10 enabled', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_10_enabled', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_zone_10_enabled-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': '12345 Zone 10 enabled', + 'icon': 'mdi:cog', + }), + 'context': , + 'entity_id': 'switch.12345_zone_10_enabled', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switches[switch.12345_zone_11-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': None, + 'entity_id': 'switch.12345_zone_11', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:water', + 'original_name': 'Zone 11', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_11', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_zone_11-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'area': 92.9, + 'current_cycle': 0, + 'field_capacity': 0.3, + 'friendly_name': '12345 Zone 11', + 'icon': 'mdi:water', + 'id': 11, + 'number_of_cycles': 0, + 'restrictions': False, + 'slope': 'Flat', + 'soil_type': 'Clay Loam', + 'sprinkler_head_precipitation_rate': 35.56, + 'sprinkler_head_type': 'Popup Spray', + 'status': , + 'sun_exposure': 'Full Sun', + 'vegetation_type': 'Cool Season Grass', + }), + 'context': , + 'entity_id': 'switch.12345_zone_11', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switches[switch.12345_zone_11_enabled-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.12345_zone_11_enabled', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:cog', + 'original_name': 'Zone 11 enabled', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_11_enabled', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_zone_11_enabled-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': '12345 Zone 11 enabled', + 'icon': 'mdi:cog', + }), + 'context': , + 'entity_id': 'switch.12345_zone_11_enabled', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switches[switch.12345_zone_12-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': None, + 'entity_id': 'switch.12345_zone_12', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:water', + 'original_name': 'Zone 12', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_12', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_zone_12-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'area': 92.9, + 'current_cycle': 0, + 'field_capacity': 0.3, + 'friendly_name': '12345 Zone 12', + 'icon': 'mdi:water', + 'id': 12, + 'number_of_cycles': 0, + 'restrictions': False, + 'slope': 'Flat', + 'soil_type': 'Clay Loam', + 'sprinkler_head_precipitation_rate': 35.56, + 'sprinkler_head_type': 'Popup Spray', + 'status': , + 'sun_exposure': 'Full Sun', + 'vegetation_type': 'Cool Season Grass', + }), + 'context': , + 'entity_id': 'switch.12345_zone_12', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switches[switch.12345_zone_12_enabled-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.12345_zone_12_enabled', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:cog', + 'original_name': 'Zone 12 enabled', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_12_enabled', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_zone_12_enabled-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': '12345 Zone 12 enabled', + 'icon': 'mdi:cog', + }), + 'context': , + 'entity_id': 'switch.12345_zone_12_enabled', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switches[switch.12345_zone_4-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': None, + 'entity_id': 'switch.12345_zone_4', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:water', + 'original_name': 'Zone 4', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_4', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_zone_4-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'area': 92.9, + 'current_cycle': 0, + 'field_capacity': 0.3, + 'friendly_name': '12345 Zone 4', + 'icon': 'mdi:water', + 'id': 4, + 'number_of_cycles': 0, + 'restrictions': False, + 'slope': 'Flat', + 'soil_type': 'Clay Loam', + 'sprinkler_head_precipitation_rate': 35.56, + 'sprinkler_head_type': 'Popup Spray', + 'status': , + 'sun_exposure': 'Full Sun', + 'vegetation_type': 'Cool Season Grass', + }), + 'context': , + 'entity_id': 'switch.12345_zone_4', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switches[switch.12345_zone_4_enabled-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.12345_zone_4_enabled', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:cog', + 'original_name': 'Zone 4 enabled', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_4_enabled', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_zone_4_enabled-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': '12345 Zone 4 enabled', + 'icon': 'mdi:cog', + }), + 'context': , + 'entity_id': 'switch.12345_zone_4_enabled', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switches[switch.12345_zone_5-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': None, + 'entity_id': 'switch.12345_zone_5', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:water', + 'original_name': 'Zone 5', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_5', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_zone_5-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'area': 92.9, + 'current_cycle': 0, + 'field_capacity': 0.3, + 'friendly_name': '12345 Zone 5', + 'icon': 'mdi:water', + 'id': 5, + 'number_of_cycles': 0, + 'restrictions': False, + 'slope': 'Flat', + 'soil_type': 'Clay Loam', + 'sprinkler_head_precipitation_rate': 35.56, + 'sprinkler_head_type': 'Popup Spray', + 'status': , + 'sun_exposure': 'Full Sun', + 'vegetation_type': 'Cool Season Grass', + }), + 'context': , + 'entity_id': 'switch.12345_zone_5', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switches[switch.12345_zone_5_enabled-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.12345_zone_5_enabled', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:cog', + 'original_name': 'Zone 5 enabled', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_5_enabled', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_zone_5_enabled-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': '12345 Zone 5 enabled', + 'icon': 'mdi:cog', + }), + 'context': , + 'entity_id': 'switch.12345_zone_5_enabled', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switches[switch.12345_zone_6-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': None, + 'entity_id': 'switch.12345_zone_6', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:water', + 'original_name': 'Zone 6', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_6', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_zone_6-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'area': 92.9, + 'current_cycle': 0, + 'field_capacity': 0.3, + 'friendly_name': '12345 Zone 6', + 'icon': 'mdi:water', + 'id': 6, + 'number_of_cycles': 0, + 'restrictions': False, + 'slope': 'Flat', + 'soil_type': 'Clay Loam', + 'sprinkler_head_precipitation_rate': 35.56, + 'sprinkler_head_type': 'Popup Spray', + 'status': , + 'sun_exposure': 'Full Sun', + 'vegetation_type': 'Cool Season Grass', + }), + 'context': , + 'entity_id': 'switch.12345_zone_6', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switches[switch.12345_zone_6_enabled-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.12345_zone_6_enabled', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:cog', + 'original_name': 'Zone 6 enabled', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_6_enabled', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_zone_6_enabled-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': '12345 Zone 6 enabled', + 'icon': 'mdi:cog', + }), + 'context': , + 'entity_id': 'switch.12345_zone_6_enabled', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switches[switch.12345_zone_7-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': None, + 'entity_id': 'switch.12345_zone_7', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:water', + 'original_name': 'Zone 7', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_7', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_zone_7-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'area': 92.9, + 'current_cycle': 0, + 'field_capacity': 0.3, + 'friendly_name': '12345 Zone 7', + 'icon': 'mdi:water', + 'id': 7, + 'number_of_cycles': 0, + 'restrictions': False, + 'slope': 'Flat', + 'soil_type': 'Clay Loam', + 'sprinkler_head_precipitation_rate': 35.56, + 'sprinkler_head_type': 'Popup Spray', + 'status': , + 'sun_exposure': 'Full Sun', + 'vegetation_type': 'Cool Season Grass', + }), + 'context': , + 'entity_id': 'switch.12345_zone_7', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switches[switch.12345_zone_7_enabled-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.12345_zone_7_enabled', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:cog', + 'original_name': 'Zone 7 enabled', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_7_enabled', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_zone_7_enabled-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': '12345 Zone 7 enabled', + 'icon': 'mdi:cog', + }), + 'context': , + 'entity_id': 'switch.12345_zone_7_enabled', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switches[switch.12345_zone_8-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': None, + 'entity_id': 'switch.12345_zone_8', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:water', + 'original_name': 'Zone 8', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_8', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_zone_8-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'area': 92.9, + 'current_cycle': 0, + 'field_capacity': 0.3, + 'friendly_name': '12345 Zone 8', + 'icon': 'mdi:water', + 'id': 8, + 'number_of_cycles': 0, + 'restrictions': False, + 'slope': 'Flat', + 'soil_type': 'Clay Loam', + 'sprinkler_head_precipitation_rate': 35.56, + 'sprinkler_head_type': 'Popup Spray', + 'status': , + 'sun_exposure': 'Full Sun', + 'vegetation_type': 'Cool Season Grass', + }), + 'context': , + 'entity_id': 'switch.12345_zone_8', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switches[switch.12345_zone_8_enabled-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.12345_zone_8_enabled', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:cog', + 'original_name': 'Zone 8 enabled', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_8_enabled', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_zone_8_enabled-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': '12345 Zone 8 enabled', + 'icon': 'mdi:cog', + }), + 'context': , + 'entity_id': 'switch.12345_zone_8_enabled', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switches[switch.12345_zone_9-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': None, + 'entity_id': 'switch.12345_zone_9', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:water', + 'original_name': 'Zone 9', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_9', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_zone_9-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'area': 92.9, + 'current_cycle': 0, + 'field_capacity': 0.3, + 'friendly_name': '12345 Zone 9', + 'icon': 'mdi:water', + 'id': 9, + 'number_of_cycles': 0, + 'restrictions': False, + 'slope': 'Flat', + 'soil_type': 'Clay Loam', + 'sprinkler_head_precipitation_rate': 35.56, + 'sprinkler_head_type': 'Popup Spray', + 'status': , + 'sun_exposure': 'Full Sun', + 'vegetation_type': 'Cool Season Grass', + }), + 'context': , + 'entity_id': 'switch.12345_zone_9', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- +# name: test_switches[switch.12345_zone_9_enabled-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': None, + 'config_entry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'switch', + 'entity_category': , + 'entity_id': 'switch.12345_zone_9_enabled', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': None, + 'original_icon': 'mdi:cog', + 'original_name': 'Zone 9 enabled', + 'platform': 'rainmachine', + 'previous_unique_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': 'aa:bb:cc:dd:ee:ff_zone_9_enabled', + 'unit_of_measurement': None, + }) +# --- +# name: test_switches[switch.12345_zone_9_enabled-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'friendly_name': '12345 Zone 9 enabled', + 'icon': 'mdi:cog', + }), + 'context': , + 'entity_id': 'switch.12345_zone_9_enabled', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': 'off', + }) +# --- diff --git a/tests/components/rainmachine/test_binary_sensor.py b/tests/components/rainmachine/test_binary_sensor.py new file mode 100644 index 00000000000..d428993da51 --- /dev/null +++ b/tests/components/rainmachine/test_binary_sensor.py @@ -0,0 +1,36 @@ +"""Test RainMachine binary sensors.""" + +from typing import Any +from unittest.mock import AsyncMock, patch + +import pytest +from syrupy import SnapshotAssertion + +from homeassistant.components.rainmachine import DOMAIN +from homeassistant.const import Platform +from homeassistant.core import HomeAssistant +from homeassistant.helpers import entity_registry as er +from homeassistant.setup import async_setup_component + +from tests.common import MockConfigEntry, snapshot_platform + + +@pytest.mark.usefixtures("entity_registry_enabled_by_default") +async def test_binary_sensors( + hass: HomeAssistant, + entity_registry: er.EntityRegistry, + snapshot: SnapshotAssertion, + config: dict[str, Any], + config_entry: MockConfigEntry, + client: AsyncMock, +) -> None: + """Test binary sensors.""" + with ( + patch("homeassistant.components.rainmachine.Client", return_value=client), + patch( + "homeassistant.components.rainmachine.PLATFORMS", [Platform.BINARY_SENSOR] + ), + ): + assert await async_setup_component(hass, DOMAIN, config) + await hass.async_block_till_done() + await snapshot_platform(hass, entity_registry, snapshot, config_entry.entry_id) diff --git a/tests/components/rainmachine/test_button.py b/tests/components/rainmachine/test_button.py new file mode 100644 index 00000000000..629c325c79e --- /dev/null +++ b/tests/components/rainmachine/test_button.py @@ -0,0 +1,32 @@ +"""Test RainMachine buttons.""" + +from typing import Any +from unittest.mock import AsyncMock, patch + +from syrupy import SnapshotAssertion + +from homeassistant.components.rainmachine import DOMAIN +from homeassistant.const import Platform +from homeassistant.core import HomeAssistant +from homeassistant.helpers import entity_registry as er +from homeassistant.setup import async_setup_component + +from tests.common import MockConfigEntry, snapshot_platform + + +async def test_buttons( + hass: HomeAssistant, + entity_registry: er.EntityRegistry, + snapshot: SnapshotAssertion, + config: dict[str, Any], + config_entry: MockConfigEntry, + client: AsyncMock, +) -> None: + """Test buttons.""" + with ( + patch("homeassistant.components.rainmachine.Client", return_value=client), + patch("homeassistant.components.rainmachine.PLATFORMS", [Platform.BUTTON]), + ): + assert await async_setup_component(hass, DOMAIN, config) + await hass.async_block_till_done() + await snapshot_platform(hass, entity_registry, snapshot, config_entry.entry_id) diff --git a/tests/components/rainmachine/test_select.py b/tests/components/rainmachine/test_select.py new file mode 100644 index 00000000000..ca9ce2e644d --- /dev/null +++ b/tests/components/rainmachine/test_select.py @@ -0,0 +1,32 @@ +"""Test RainMachine select entities.""" + +from typing import Any +from unittest.mock import AsyncMock, patch + +from syrupy import SnapshotAssertion + +from homeassistant.components.rainmachine import DOMAIN +from homeassistant.const import Platform +from homeassistant.core import HomeAssistant +from homeassistant.helpers import entity_registry as er +from homeassistant.setup import async_setup_component + +from tests.common import MockConfigEntry, snapshot_platform + + +async def test_select_entities( + hass: HomeAssistant, + entity_registry: er.EntityRegistry, + snapshot: SnapshotAssertion, + config: dict[str, Any], + config_entry: MockConfigEntry, + client: AsyncMock, +) -> None: + """Test select entities.""" + with ( + patch("homeassistant.components.rainmachine.Client", return_value=client), + patch("homeassistant.components.rainmachine.PLATFORMS", [Platform.SELECT]), + ): + assert await async_setup_component(hass, DOMAIN, config) + await hass.async_block_till_done() + await snapshot_platform(hass, entity_registry, snapshot, config_entry.entry_id) diff --git a/tests/components/rainmachine/test_sensor.py b/tests/components/rainmachine/test_sensor.py new file mode 100644 index 00000000000..3ff533b6da0 --- /dev/null +++ b/tests/components/rainmachine/test_sensor.py @@ -0,0 +1,34 @@ +"""Test RainMachine sensors.""" + +from typing import Any +from unittest.mock import AsyncMock, patch + +import pytest +from syrupy import SnapshotAssertion + +from homeassistant.components.rainmachine import DOMAIN +from homeassistant.const import Platform +from homeassistant.core import HomeAssistant +from homeassistant.helpers import entity_registry as er +from homeassistant.setup import async_setup_component + +from tests.common import MockConfigEntry, snapshot_platform + + +@pytest.mark.usefixtures("entity_registry_enabled_by_default") +async def test_sensors( + hass: HomeAssistant, + entity_registry: er.EntityRegistry, + snapshot: SnapshotAssertion, + config: dict[str, Any], + config_entry: MockConfigEntry, + client: AsyncMock, +) -> None: + """Test sensors.""" + with ( + patch("homeassistant.components.rainmachine.Client", return_value=client), + patch("homeassistant.components.rainmachine.PLATFORMS", [Platform.SENSOR]), + ): + assert await async_setup_component(hass, DOMAIN, config) + await hass.async_block_till_done() + await snapshot_platform(hass, entity_registry, snapshot, config_entry.entry_id) diff --git a/tests/components/rainmachine/test_switch.py b/tests/components/rainmachine/test_switch.py new file mode 100644 index 00000000000..50e73a78efe --- /dev/null +++ b/tests/components/rainmachine/test_switch.py @@ -0,0 +1,34 @@ +"""Test RainMachine switches.""" + +from typing import Any +from unittest.mock import AsyncMock, patch + +import pytest +from syrupy import SnapshotAssertion + +from homeassistant.components.rainmachine import DOMAIN +from homeassistant.const import Platform +from homeassistant.core import HomeAssistant +from homeassistant.helpers import entity_registry as er +from homeassistant.setup import async_setup_component + +from tests.common import MockConfigEntry, snapshot_platform + + +@pytest.mark.usefixtures("entity_registry_enabled_by_default") +async def test_switches( + hass: HomeAssistant, + entity_registry: er.EntityRegistry, + snapshot: SnapshotAssertion, + config: dict[str, Any], + config_entry: MockConfigEntry, + client: AsyncMock, +) -> None: + """Test switches.""" + with ( + patch("homeassistant.components.rainmachine.Client", return_value=client), + patch("homeassistant.components.rainmachine.PLATFORMS", [Platform.SWITCH]), + ): + assert await async_setup_component(hass, DOMAIN, config) + await hass.async_block_till_done() + await snapshot_platform(hass, entity_registry, snapshot, config_entry.entry_id)