Add remaining snapshot testing to Sensibo (#131105)

pull/131213/head
G Johansson 2024-11-21 20:49:59 +01:00 committed by GitHub
parent 3cfd958dc2
commit e9286971aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
10 changed files with 1654 additions and 70 deletions

View File

@ -0,0 +1,705 @@
# serializer version: 1
# name: test_binary_sensor[load_platforms0][binary_sensor.bedroom_filter_clean_required-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.bedroom_filter_clean_required',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.PROBLEM: 'problem'>,
'original_icon': None,
'original_name': 'Filter clean required',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'filter_clean',
'unique_id': 'BBZZBBZZ-filter_clean',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.bedroom_filter_clean_required-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'problem',
'friendly_name': 'Bedroom Filter clean required',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.bedroom_filter_clean_required',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.bedroom_pure_boost_linked_with_ac-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'binary_sensor.bedroom_pure_boost_linked_with_ac',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.CONNECTIVITY: 'connectivity'>,
'original_icon': None,
'original_name': 'Pure Boost linked with AC',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'pure_ac_integration',
'unique_id': 'BBZZBBZZ-pure_ac_integration',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.bedroom_pure_boost_linked_with_ac-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'connectivity',
'friendly_name': 'Bedroom Pure Boost linked with AC',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.bedroom_pure_boost_linked_with_ac',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.bedroom_pure_boost_linked_with_indoor_air_quality-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'binary_sensor.bedroom_pure_boost_linked_with_indoor_air_quality',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.CONNECTIVITY: 'connectivity'>,
'original_icon': None,
'original_name': 'Pure Boost linked with indoor air quality',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'pure_measure_integration',
'unique_id': 'BBZZBBZZ-pure_measure_integration',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.bedroom_pure_boost_linked_with_indoor_air_quality-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'connectivity',
'friendly_name': 'Bedroom Pure Boost linked with indoor air quality',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.bedroom_pure_boost_linked_with_indoor_air_quality',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.bedroom_pure_boost_linked_with_outdoor_air_quality-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'binary_sensor.bedroom_pure_boost_linked_with_outdoor_air_quality',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.CONNECTIVITY: 'connectivity'>,
'original_icon': None,
'original_name': 'Pure Boost linked with outdoor air quality',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'pure_prime_integration',
'unique_id': 'BBZZBBZZ-pure_prime_integration',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.bedroom_pure_boost_linked_with_outdoor_air_quality-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'connectivity',
'friendly_name': 'Bedroom Pure Boost linked with outdoor air quality',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.bedroom_pure_boost_linked_with_outdoor_air_quality',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.bedroom_pure_boost_linked_with_presence-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'binary_sensor.bedroom_pure_boost_linked_with_presence',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.CONNECTIVITY: 'connectivity'>,
'original_icon': None,
'original_name': 'Pure Boost linked with presence',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'pure_geo_integration',
'unique_id': 'BBZZBBZZ-pure_geo_integration',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.bedroom_pure_boost_linked_with_presence-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'connectivity',
'friendly_name': 'Bedroom Pure Boost linked with presence',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.bedroom_pure_boost_linked_with_presence',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.hallway_filter_clean_required-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.hallway_filter_clean_required',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.PROBLEM: 'problem'>,
'original_icon': None,
'original_name': 'Filter clean required',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'filter_clean',
'unique_id': 'ABC999111-filter_clean',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.hallway_filter_clean_required-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'problem',
'friendly_name': 'Hallway Filter clean required',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.hallway_filter_clean_required',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.hallway_motion_sensor_connectivity-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'binary_sensor.hallway_motion_sensor_connectivity',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.CONNECTIVITY: 'connectivity'>,
'original_icon': None,
'original_name': 'Connectivity',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': 'AABBCC-alive',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.hallway_motion_sensor_connectivity-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'connectivity',
'friendly_name': 'Hallway Motion Sensor Connectivity',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.hallway_motion_sensor_connectivity',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.hallway_motion_sensor_main_sensor-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'binary_sensor.hallway_motion_sensor_main_sensor',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Main sensor',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'is_main_sensor',
'unique_id': 'AABBCC-is_main_sensor',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.hallway_motion_sensor_main_sensor-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Hallway Motion Sensor Main sensor',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.hallway_motion_sensor_main_sensor',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.hallway_motion_sensor_motion-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.hallway_motion_sensor_motion',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.MOTION: 'motion'>,
'original_icon': None,
'original_name': 'Motion',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': 'AABBCC-motion',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.hallway_motion_sensor_motion-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'motion',
'friendly_name': 'Hallway Motion Sensor Motion',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.hallway_motion_sensor_motion',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.hallway_room_occupied-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.hallway_room_occupied',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.MOTION: 'motion'>,
'original_icon': None,
'original_name': 'Room occupied',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'room_occupied',
'unique_id': 'ABC999111-room_occupied',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.hallway_room_occupied-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'motion',
'friendly_name': 'Hallway Room occupied',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.hallway_room_occupied',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.kitchen_filter_clean_required-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': None,
'entity_id': 'binary_sensor.kitchen_filter_clean_required',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.PROBLEM: 'problem'>,
'original_icon': None,
'original_name': 'Filter clean required',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'filter_clean',
'unique_id': 'AAZZAAZZ-filter_clean',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.kitchen_filter_clean_required-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'problem',
'friendly_name': 'Kitchen Filter clean required',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.kitchen_filter_clean_required',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.kitchen_pure_boost_linked_with_ac-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'binary_sensor.kitchen_pure_boost_linked_with_ac',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.CONNECTIVITY: 'connectivity'>,
'original_icon': None,
'original_name': 'Pure Boost linked with AC',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'pure_ac_integration',
'unique_id': 'AAZZAAZZ-pure_ac_integration',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.kitchen_pure_boost_linked_with_ac-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'connectivity',
'friendly_name': 'Kitchen Pure Boost linked with AC',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.kitchen_pure_boost_linked_with_ac',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.kitchen_pure_boost_linked_with_indoor_air_quality-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'binary_sensor.kitchen_pure_boost_linked_with_indoor_air_quality',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.CONNECTIVITY: 'connectivity'>,
'original_icon': None,
'original_name': 'Pure Boost linked with indoor air quality',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'pure_measure_integration',
'unique_id': 'AAZZAAZZ-pure_measure_integration',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.kitchen_pure_boost_linked_with_indoor_air_quality-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'connectivity',
'friendly_name': 'Kitchen Pure Boost linked with indoor air quality',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.kitchen_pure_boost_linked_with_indoor_air_quality',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.kitchen_pure_boost_linked_with_outdoor_air_quality-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'binary_sensor.kitchen_pure_boost_linked_with_outdoor_air_quality',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.CONNECTIVITY: 'connectivity'>,
'original_icon': None,
'original_name': 'Pure Boost linked with outdoor air quality',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'pure_prime_integration',
'unique_id': 'AAZZAAZZ-pure_prime_integration',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.kitchen_pure_boost_linked_with_outdoor_air_quality-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'connectivity',
'friendly_name': 'Kitchen Pure Boost linked with outdoor air quality',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.kitchen_pure_boost_linked_with_outdoor_air_quality',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.kitchen_pure_boost_linked_with_presence-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'binary_sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'binary_sensor.kitchen_pure_boost_linked_with_presence',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <BinarySensorDeviceClass.CONNECTIVITY: 'connectivity'>,
'original_icon': None,
'original_name': 'Pure Boost linked with presence',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'pure_geo_integration',
'unique_id': 'AAZZAAZZ-pure_geo_integration',
'unit_of_measurement': None,
})
# ---
# name: test_binary_sensor[load_platforms0][binary_sensor.kitchen_pure_boost_linked_with_presence-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'connectivity',
'friendly_name': 'Kitchen Pure Boost linked with presence',
}),
'context': <ANY>,
'entity_id': 'binary_sensor.kitchen_pure_boost_linked_with_presence',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---

View File

@ -0,0 +1,139 @@
# serializer version: 1
# name: test_button[load_platforms0][button.bedroom_reset_filter-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'button',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'button.bedroom_reset_filter',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Reset filter',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'reset_filter',
'unique_id': 'BBZZBBZZ-reset_filter',
'unit_of_measurement': None,
})
# ---
# name: test_button[load_platforms0][button.bedroom_reset_filter-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Bedroom Reset filter',
}),
'context': <ANY>,
'entity_id': 'button.bedroom_reset_filter',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_button[load_platforms0][button.hallway_reset_filter-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'button',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'button.hallway_reset_filter',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Reset filter',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'reset_filter',
'unique_id': 'ABC999111-reset_filter',
'unit_of_measurement': None,
})
# ---
# name: test_button[load_platforms0][button.hallway_reset_filter-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Hallway Reset filter',
}),
'context': <ANY>,
'entity_id': 'button.hallway_reset_filter',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_button[load_platforms0][button.kitchen_reset_filter-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'button',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'button.kitchen_reset_filter',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Reset filter',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'reset_filter',
'unique_id': 'AAZZAAZZ-reset_filter',
'unit_of_measurement': None,
})
# ---
# name: test_button[load_platforms0][button.kitchen_reset_filter-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Kitchen Reset filter',
}),
'context': <ANY>,
'entity_id': 'button.kitchen_reset_filter',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---

View File

@ -1,33 +1,230 @@
# serializer version: 1
# name: test_climate
ReadOnlyDict({
'current_humidity': 32.9,
'current_temperature': 21.2,
'fan_mode': 'high',
'fan_modes': list([
'quiet',
'low',
'medium',
]),
'friendly_name': 'Hallway',
'hvac_modes': list([
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.OFF: 'off'>,
]),
'max_temp': 20,
'min_temp': 10,
'supported_features': <ClimateEntityFeature: 425>,
'swing_mode': 'stopped',
'swing_modes': list([
'stopped',
'fixedtop',
'fixedmiddletop',
]),
'target_temp_step': 1,
'temperature': 25,
# name: test_climate[load_platforms0][climate.bedroom-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'hvac_modes': list([
<HVACMode.OFF: 'off'>,
]),
'max_temp': 1,
'min_temp': 0,
'target_temp_step': 1,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'climate',
'entity_category': None,
'entity_id': 'climate.bedroom',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': None,
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': <ClimateEntityFeature: 384>,
'translation_key': 'climate_device',
'unique_id': 'BBZZBBZZ',
'unit_of_measurement': None,
})
# ---
# name: test_climate[load_platforms0][climate.bedroom-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'current_temperature': None,
'friendly_name': 'Bedroom',
'hvac_modes': list([
<HVACMode.OFF: 'off'>,
]),
'max_temp': 1,
'min_temp': 0,
'supported_features': <ClimateEntityFeature: 384>,
'target_temp_step': 1,
}),
'context': <ANY>,
'entity_id': 'climate.bedroom',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_climate[load_platforms0][climate.hallway-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'fan_modes': list([
'quiet',
'low',
'medium',
]),
'hvac_modes': list([
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.OFF: 'off'>,
]),
'max_temp': 20,
'min_temp': 10,
'swing_modes': list([
'stopped',
'fixedtop',
'fixedmiddletop',
]),
'target_temp_step': 1,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'climate',
'entity_category': None,
'entity_id': 'climate.hallway',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': None,
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': <ClimateEntityFeature: 425>,
'translation_key': 'climate_device',
'unique_id': 'ABC999111',
'unit_of_measurement': None,
})
# ---
# name: test_climate[load_platforms0][climate.hallway-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'current_humidity': 32.9,
'current_temperature': 21.2,
'fan_mode': 'high',
'fan_modes': list([
'quiet',
'low',
'medium',
]),
'friendly_name': 'Hallway',
'hvac_modes': list([
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.OFF: 'off'>,
]),
'max_temp': 20,
'min_temp': 10,
'supported_features': <ClimateEntityFeature: 425>,
'swing_mode': 'stopped',
'swing_modes': list([
'stopped',
'fixedtop',
'fixedmiddletop',
]),
'target_temp_step': 1,
'temperature': 25,
}),
'context': <ANY>,
'entity_id': 'climate.hallway',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'heat',
})
# ---
# name: test_climate[load_platforms0][climate.kitchen-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'fan_modes': list([
'low',
'high',
]),
'hvac_modes': list([
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.OFF: 'off'>,
]),
'max_temp': 1,
'min_temp': 0,
'target_temp_step': 1,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'climate',
'entity_category': None,
'entity_id': 'climate.kitchen',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': None,
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': <ClimateEntityFeature: 393>,
'translation_key': 'climate_device',
'unique_id': 'AAZZAAZZ',
'unit_of_measurement': None,
})
# ---
# name: test_climate[load_platforms0][climate.kitchen-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'current_temperature': None,
'fan_mode': 'low',
'fan_modes': list([
'low',
'high',
]),
'friendly_name': 'Kitchen',
'hvac_modes': list([
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.OFF: 'off'>,
]),
'max_temp': 1,
'min_temp': 0,
'supported_features': <ClimateEntityFeature: 393>,
'target_temp_step': 1,
'temperature': None,
}),
'context': <ANY>,
'entity_id': 'climate.kitchen',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---

View File

@ -0,0 +1,343 @@
# serializer version: 1
# name: test_number[load_platforms0][number.bedroom_humidity_calibration-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'max': 10,
'min': -10,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 0.1,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.bedroom_humidity_calibration',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <NumberDeviceClass.HUMIDITY: 'humidity'>,
'original_icon': None,
'original_name': 'Humidity calibration',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'calibration_humidity',
'unique_id': 'BBZZBBZZ-calibration_hum',
'unit_of_measurement': '%',
})
# ---
# name: test_number[load_platforms0][number.bedroom_humidity_calibration-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'humidity',
'friendly_name': 'Bedroom Humidity calibration',
'max': 10,
'min': -10,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 0.1,
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'number.bedroom_humidity_calibration',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '0.0',
})
# ---
# name: test_number[load_platforms0][number.bedroom_temperature_calibration-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'max': 10,
'min': -10,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 0.1,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.bedroom_temperature_calibration',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <NumberDeviceClass.TEMPERATURE: 'temperature'>,
'original_icon': None,
'original_name': 'Temperature calibration',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'calibration_temperature',
'unique_id': 'BBZZBBZZ-calibration_temp',
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
})
# ---
# name: test_number[load_platforms0][number.bedroom_temperature_calibration-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'temperature',
'friendly_name': 'Bedroom Temperature calibration',
'max': 10,
'min': -10,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 0.1,
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
}),
'context': <ANY>,
'entity_id': 'number.bedroom_temperature_calibration',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '0.0',
})
# ---
# name: test_number[load_platforms0][number.hallway_humidity_calibration-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'max': 10,
'min': -10,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 0.1,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.hallway_humidity_calibration',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <NumberDeviceClass.HUMIDITY: 'humidity'>,
'original_icon': None,
'original_name': 'Humidity calibration',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'calibration_humidity',
'unique_id': 'ABC999111-calibration_hum',
'unit_of_measurement': '%',
})
# ---
# name: test_number[load_platforms0][number.hallway_humidity_calibration-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'humidity',
'friendly_name': 'Hallway Humidity calibration',
'max': 10,
'min': -10,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 0.1,
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'number.hallway_humidity_calibration',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '0.0',
})
# ---
# name: test_number[load_platforms0][number.hallway_temperature_calibration-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'max': 10,
'min': -10,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 0.1,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.hallway_temperature_calibration',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <NumberDeviceClass.TEMPERATURE: 'temperature'>,
'original_icon': None,
'original_name': 'Temperature calibration',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'calibration_temperature',
'unique_id': 'ABC999111-calibration_temp',
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
})
# ---
# name: test_number[load_platforms0][number.hallway_temperature_calibration-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'temperature',
'friendly_name': 'Hallway Temperature calibration',
'max': 10,
'min': -10,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 0.1,
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
}),
'context': <ANY>,
'entity_id': 'number.hallway_temperature_calibration',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '0.1',
})
# ---
# name: test_number[load_platforms0][number.kitchen_humidity_calibration-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'max': 10,
'min': -10,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 0.1,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.kitchen_humidity_calibration',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <NumberDeviceClass.HUMIDITY: 'humidity'>,
'original_icon': None,
'original_name': 'Humidity calibration',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'calibration_humidity',
'unique_id': 'AAZZAAZZ-calibration_hum',
'unit_of_measurement': '%',
})
# ---
# name: test_number[load_platforms0][number.kitchen_humidity_calibration-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'humidity',
'friendly_name': 'Kitchen Humidity calibration',
'max': 10,
'min': -10,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 0.1,
'unit_of_measurement': '%',
}),
'context': <ANY>,
'entity_id': 'number.kitchen_humidity_calibration',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '0.0',
})
# ---
# name: test_number[load_platforms0][number.kitchen_temperature_calibration-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'max': 10,
'min': -10,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 0.1,
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.kitchen_temperature_calibration',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': <NumberDeviceClass.TEMPERATURE: 'temperature'>,
'original_icon': None,
'original_name': 'Temperature calibration',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'calibration_temperature',
'unique_id': 'AAZZAAZZ-calibration_temp',
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
})
# ---
# name: test_number[load_platforms0][number.kitchen_temperature_calibration-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'device_class': 'temperature',
'friendly_name': 'Kitchen Temperature calibration',
'max': 10,
'min': -10,
'mode': <NumberMode.AUTO: 'auto'>,
'step': 0.1,
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
}),
'context': <ANY>,
'entity_id': 'number.kitchen_temperature_calibration',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '0.0',
})
# ---

View File

@ -0,0 +1,170 @@
# serializer version: 1
# name: test_select[load_platforms0][select.hallway_horizontal_swing-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'options': list([
'stopped',
'fixedleft',
'fixedcenterleft',
]),
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'select',
'entity_category': None,
'entity_id': 'select.hallway_horizontal_swing',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Horizontal swing',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'horizontalswing',
'unique_id': 'ABC999111-horizontalSwing',
'unit_of_measurement': None,
})
# ---
# name: test_select[load_platforms0][select.hallway_horizontal_swing-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Hallway Horizontal swing',
'options': list([
'stopped',
'fixedleft',
'fixedcenterleft',
]),
}),
'context': <ANY>,
'entity_id': 'select.hallway_horizontal_swing',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'stopped',
})
# ---
# name: test_select[load_platforms0][select.hallway_light-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'options': list([
'on',
'off',
]),
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'select',
'entity_category': None,
'entity_id': 'select.hallway_light',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Light',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'light',
'unique_id': 'ABC999111-light',
'unit_of_measurement': None,
})
# ---
# name: test_select[load_platforms0][select.hallway_light-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Hallway Light',
'options': list([
'on',
'off',
]),
}),
'context': <ANY>,
'entity_id': 'select.hallway_light',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---
# name: test_select[load_platforms0][select.kitchen_light-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'options': list([
'on',
'dim',
'off',
]),
}),
'config_entry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'select',
'entity_category': None,
'entity_id': 'select.kitchen_light',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Light',
'platform': 'sensibo',
'previous_unique_id': None,
'supported_features': 0,
'translation_key': 'light',
'unique_id': 'AAZZAAZZ-light',
'unit_of_measurement': None,
})
# ---
# name: test_select[load_platforms0][select.kitchen_light-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'friendly_name': 'Kitchen Light',
'options': list([
'on',
'dim',
'off',
]),
}),
'context': <ANY>,
'entity_id': 'select.kitchen_light',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'on',
})
# ---

View File

@ -7,39 +7,33 @@ from unittest.mock import patch
from pysensibo.model import SensiboData
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
from homeassistant.util import dt as dt_util
from tests.common import async_fire_time_changed
from tests.common import async_fire_time_changed, snapshot_platform
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
@pytest.mark.parametrize(
"load_platforms",
[[Platform.BINARY_SENSOR]],
)
async def test_binary_sensor(
hass: HomeAssistant,
load_int: ConfigEntry,
monkeypatch: pytest.MonkeyPatch,
get_data: SensiboData,
entity_registry: er.EntityRegistry,
snapshot: SnapshotAssertion,
) -> None:
"""Test the Sensibo binary sensor."""
state1 = hass.states.get("binary_sensor.hallway_motion_sensor_connectivity")
state2 = hass.states.get("binary_sensor.hallway_motion_sensor_main_sensor")
state3 = hass.states.get("binary_sensor.hallway_motion_sensor_motion")
state4 = hass.states.get("binary_sensor.hallway_room_occupied")
state5 = hass.states.get(
"binary_sensor.kitchen_pure_boost_linked_with_indoor_air_quality"
)
state6 = hass.states.get(
"binary_sensor.kitchen_pure_boost_linked_with_outdoor_air_quality"
)
assert state1.state == "on"
assert state2.state == "on"
assert state3.state == "on"
assert state4.state == "on"
assert state5.state == "on"
assert state6.state == "off"
await snapshot_platform(hass, entity_registry, snapshot, load_int.entry_id)
monkeypatch.setattr(
get_data.parsed["ABC999111"].motion_sensors["AABBCC"], "alive", False

View File

@ -5,21 +5,47 @@ from __future__ import annotations
from datetime import datetime, timedelta
from unittest.mock import patch
from freezegun import freeze_time
from freezegun.api import FrozenDateTimeFactory
from pysensibo.model import SensiboData
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.button import DOMAIN as BUTTON_DOMAIN, SERVICE_PRESS
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_ENTITY_ID, STATE_OFF, STATE_ON, STATE_UNKNOWN
from homeassistant.const import (
ATTR_ENTITY_ID,
STATE_OFF,
STATE_ON,
STATE_UNKNOWN,
Platform,
)
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import entity_registry as er
from homeassistant.util import dt as dt_util
from tests.common import async_fire_time_changed
from tests.common import async_fire_time_changed, snapshot_platform
@freeze_time("2022-03-12T15:24:26+00:00")
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
@pytest.mark.parametrize(
"load_platforms",
[[Platform.BUTTON]],
)
async def test_button(
hass: HomeAssistant,
load_int: ConfigEntry,
entity_registry: er.EntityRegistry,
snapshot: SnapshotAssertion,
) -> None:
"""Test the Sensibo button."""
await snapshot_platform(hass, entity_registry, snapshot, load_int.entry_id)
async def test_button_update(
hass: HomeAssistant,
load_int: ConfigEntry,
monkeypatch: pytest.MonkeyPatch,

View File

@ -54,12 +54,14 @@ from homeassistant.const import (
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
STATE_UNKNOWN,
Platform,
)
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError, ServiceValidationError
from homeassistant.helpers import entity_registry as er
from homeassistant.util import dt as dt_util
from tests.common import async_fire_time_changed
from tests.common import async_fire_time_changed, snapshot_platform
async def test_climate_find_valid_targets() -> None:
@ -77,26 +79,22 @@ async def test_climate_find_valid_targets() -> None:
assert _find_valid_target_temp(25, valid_targets) == 20
@pytest.mark.parametrize(
"load_platforms",
[[Platform.CLIMATE]],
)
async def test_climate(
hass: HomeAssistant,
caplog: pytest.LogCaptureFixture,
get_data: SensiboData,
load_int: ConfigEntry,
entity_registry: er.EntityRegistry,
snapshot: SnapshotAssertion,
) -> None:
"""Test the Sensibo climate."""
state1 = hass.states.get("climate.hallway")
state2 = hass.states.get("climate.kitchen")
state3 = hass.states.get("climate.bedroom")
await snapshot_platform(hass, entity_registry, snapshot, load_int.entry_id)
assert state1.state == "heat"
assert state1.attributes == snapshot
assert state2.state == "off"
assert state3
assert state3.state == "off"
found_log = False
logs = caplog.get_records("setup")
for log in logs:

View File

@ -7,6 +7,7 @@ from unittest.mock import patch
from pysensibo.model import SensiboData
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.number import (
ATTR_VALUE,
@ -14,27 +15,31 @@ from homeassistant.components.number import (
SERVICE_SET_VALUE,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_ENTITY_ID
from homeassistant.const import ATTR_ENTITY_ID, Platform
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import entity_registry as er
from homeassistant.util import dt as dt_util
from tests.common import async_fire_time_changed
from tests.common import async_fire_time_changed, snapshot_platform
@pytest.mark.parametrize(
"load_platforms",
[[Platform.NUMBER]],
)
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
async def test_number(
hass: HomeAssistant,
load_int: ConfigEntry,
monkeypatch: pytest.MonkeyPatch,
get_data: SensiboData,
entity_registry: er.EntityRegistry,
snapshot: SnapshotAssertion,
) -> None:
"""Test the Sensibo number."""
state1 = hass.states.get("number.hallway_temperature_calibration")
state2 = hass.states.get("number.hallway_humidity_calibration")
assert state1.state == "0.1"
assert state2.state == "0.0"
await snapshot_platform(hass, entity_registry, snapshot, load_int.entry_id)
monkeypatch.setattr(get_data.parsed["ABC999111"], "calibration_temp", 0.2)

View File

@ -7,6 +7,7 @@ from unittest.mock import patch
from pysensibo.model import SensiboData
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.select import (
ATTR_OPTION,
@ -14,24 +15,30 @@ from homeassistant.components.select import (
SERVICE_SELECT_OPTION,
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_ENTITY_ID
from homeassistant.const import ATTR_ENTITY_ID, Platform
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import entity_registry as er
from homeassistant.util import dt as dt_util
from tests.common import async_fire_time_changed
from tests.common import async_fire_time_changed, snapshot_platform
@pytest.mark.parametrize(
"load_platforms",
[[Platform.SELECT]],
)
async def test_select(
hass: HomeAssistant,
load_int: ConfigEntry,
monkeypatch: pytest.MonkeyPatch,
get_data: SensiboData,
entity_registry: er.EntityRegistry,
snapshot: SnapshotAssertion,
) -> None:
"""Test the Sensibo select."""
state1 = hass.states.get("select.hallway_horizontal_swing")
assert state1.state == "stopped"
await snapshot_platform(hass, entity_registry, snapshot, load_int.entry_id)
monkeypatch.setattr(
get_data.parsed["ABC999111"], "horizontal_swing_mode", "fixedleft"