Use snapshot_platform in airzone (#181725)

This commit is contained in:
epenet
2026-09-09 12:50:16 +02:00
committed by GitHub
parent 7223c3836c
commit 0aedb015fa
4 changed files with 1994 additions and 267 deletions
@@ -0,0 +1,661 @@
# serializer version: 1
# name: test_airzone_create_climates[climate.airzone_2_1-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
<ClimateEntityCapabilityAttribute.FAN_MODES: 'fan_modes'>: list([
'auto',
'low',
'medium',
'75%',
'high',
]),
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.OFF: 'off'>,
]),
<ClimateEntityCapabilityAttribute.MAX_TEMP: 'max_temp'>: 30.0,
<ClimateEntityCapabilityAttribute.MIN_TEMP: 'min_temp'>: 15.0,
<ClimateEntityCapabilityAttribute.TARGET_TEMP_STEP: 'target_temp_step'>: 0.5,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'climate',
'entity_category': None,
'entity_id': 'climate.airzone_2_1',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': None,
'platform': 'airzone',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': <ClimateEntityFeature: 393>,
'translation_key': None,
'unique_id': 'airzone_unique_id_2:1',
'unit_of_measurement': None,
})
# ---
# name: test_airzone_create_climates[climate.airzone_2_1-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<ClimateEntityStateAttribute.CURRENT_HUMIDITY: 'current_humidity'>: 62,
<ClimateEntityStateAttribute.CURRENT_TEMPERATURE: 'current_temperature'>: 22.3,
<ClimateEntityStateAttribute.FAN_MODE: 'fan_mode'>: 'auto',
<ClimateEntityCapabilityAttribute.FAN_MODES: 'fan_modes'>: list([
'auto',
'low',
'medium',
'75%',
'high',
]),
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Airzone 2:1',
<ClimateEntityStateAttribute.HVAC_ACTION: 'hvac_action'>: <HVACAction.OFF: 'off'>,
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.OFF: 'off'>,
]),
<ClimateEntityCapabilityAttribute.MAX_TEMP: 'max_temp'>: 30.0,
<ClimateEntityCapabilityAttribute.MIN_TEMP: 'min_temp'>: 15.0,
<EntityStateAttribute.SUPPORTED_FEATURES: 'supported_features'>: <ClimateEntityFeature: 393>,
<ClimateEntityCapabilityAttribute.TARGET_TEMP_STEP: 'target_temp_step'>: 0.5,
<ClimateEntityStateAttribute.TARGET_TEMPERATURE: 'temperature'>: 19.0,
}),
'context': <ANY>,
'entity_id': 'climate.airzone_2_1',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_airzone_create_climates[climate.aux_heat-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.OFF: 'off'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.DRY: 'dry'>,
]),
<ClimateEntityCapabilityAttribute.MAX_TEMP: 'max_temp'>: 30.0,
<ClimateEntityCapabilityAttribute.MIN_TEMP: 'min_temp'>: 15.0,
<ClimateEntityCapabilityAttribute.TARGET_TEMP_STEP: 'target_temp_step'>: 0.5,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'climate',
'entity_category': None,
'entity_id': 'climate.aux_heat',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': None,
'platform': 'airzone',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': <ClimateEntityFeature: 385>,
'translation_key': None,
'unique_id': 'airzone_unique_id_4:1',
'unit_of_measurement': None,
})
# ---
# name: test_airzone_create_climates[climate.aux_heat-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<ClimateEntityStateAttribute.CURRENT_TEMPERATURE: 'current_temperature'>: 22.0,
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Aux Heat',
<ClimateEntityStateAttribute.HVAC_ACTION: 'hvac_action'>: <HVACAction.IDLE: 'idle'>,
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.OFF: 'off'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.DRY: 'dry'>,
]),
<ClimateEntityCapabilityAttribute.MAX_TEMP: 'max_temp'>: 30.0,
<ClimateEntityCapabilityAttribute.MIN_TEMP: 'min_temp'>: 15.0,
<EntityStateAttribute.SUPPORTED_FEATURES: 'supported_features'>: <ClimateEntityFeature: 385>,
<ClimateEntityCapabilityAttribute.TARGET_TEMP_STEP: 'target_temp_step'>: 0.5,
<ClimateEntityStateAttribute.TARGET_TEMPERATURE: 'temperature'>: 20.0,
}),
'context': <ANY>,
'entity_id': 'climate.aux_heat',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'heat',
})
# ---
# name: test_airzone_create_climates[climate.despacho-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.OFF: 'off'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.DRY: 'dry'>,
]),
<ClimateEntityCapabilityAttribute.MAX_TEMP: 'max_temp'>: 30.0,
<ClimateEntityCapabilityAttribute.MIN_TEMP: 'min_temp'>: 15.0,
<ClimateEntityCapabilityAttribute.TARGET_TEMP_STEP: 'target_temp_step'>: 1.0,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'climate',
'entity_category': None,
'entity_id': 'climate.despacho',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': None,
'platform': 'airzone',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': <ClimateEntityFeature: 385>,
'translation_key': None,
'unique_id': 'airzone_unique_id_1:4',
'unit_of_measurement': None,
})
# ---
# name: test_airzone_create_climates[climate.despacho-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<ClimateEntityStateAttribute.CURRENT_HUMIDITY: 'current_humidity'>: 36,
<ClimateEntityStateAttribute.CURRENT_TEMPERATURE: 'current_temperature'>: 21.2,
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Despacho',
<ClimateEntityStateAttribute.HVAC_ACTION: 'hvac_action'>: <HVACAction.OFF: 'off'>,
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.OFF: 'off'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.DRY: 'dry'>,
]),
<ClimateEntityCapabilityAttribute.MAX_TEMP: 'max_temp'>: 30.0,
<ClimateEntityCapabilityAttribute.MIN_TEMP: 'min_temp'>: 15.0,
<EntityStateAttribute.SUPPORTED_FEATURES: 'supported_features'>: <ClimateEntityFeature: 385>,
<ClimateEntityCapabilityAttribute.TARGET_TEMP_STEP: 'target_temp_step'>: 1.0,
<ClimateEntityStateAttribute.TARGET_TEMPERATURE: 'temperature'>: 19.4,
}),
'context': <ANY>,
'entity_id': 'climate.despacho',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_airzone_create_climates[climate.dkn_plus-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
<ClimateEntityCapabilityAttribute.FAN_MODES: 'fan_modes'>: list([
'auto',
'low',
'40%',
'medium',
'80%',
'high',
]),
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.OFF: 'off'>,
]),
<ClimateEntityCapabilityAttribute.MAX_TEMP: 'max_temp'>: 32.2,
<ClimateEntityCapabilityAttribute.MIN_TEMP: 'min_temp'>: 17.8,
<ClimateEntityCapabilityAttribute.TARGET_TEMP_STEP: 'target_temp_step'>: 1.0,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'climate',
'entity_category': None,
'entity_id': 'climate.dkn_plus',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': None,
'platform': 'airzone',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': <ClimateEntityFeature: 395>,
'translation_key': None,
'unique_id': 'airzone_unique_id_3:1',
'unit_of_measurement': None,
})
# ---
# name: test_airzone_create_climates[climate.dkn_plus-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<ClimateEntityStateAttribute.CURRENT_TEMPERATURE: 'current_temperature'>: 21.7,
<ClimateEntityStateAttribute.FAN_MODE: 'fan_mode'>: '40%',
<ClimateEntityCapabilityAttribute.FAN_MODES: 'fan_modes'>: list([
'auto',
'low',
'40%',
'medium',
'80%',
'high',
]),
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'DKN Plus',
<ClimateEntityStateAttribute.HVAC_ACTION: 'hvac_action'>: <HVACAction.COOLING: 'cooling'>,
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.OFF: 'off'>,
]),
<ClimateEntityCapabilityAttribute.MAX_TEMP: 'max_temp'>: 32.2,
<ClimateEntityCapabilityAttribute.MIN_TEMP: 'min_temp'>: 17.8,
<EntityStateAttribute.SUPPORTED_FEATURES: 'supported_features'>: <ClimateEntityFeature: 395>,
<ClimateEntityStateAttribute.TARGET_TEMP_HIGH: 'target_temp_high'>: 25.0,
<ClimateEntityStateAttribute.TARGET_TEMP_LOW: 'target_temp_low'>: 22.8,
<ClimateEntityCapabilityAttribute.TARGET_TEMP_STEP: 'target_temp_step'>: 1.0,
<ClimateEntityStateAttribute.TARGET_TEMPERATURE: 'temperature'>: None,
}),
'context': <ANY>,
'entity_id': 'climate.dkn_plus',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'heat_cool',
})
# ---
# name: test_airzone_create_climates[climate.dorm_1-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.OFF: 'off'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.DRY: 'dry'>,
]),
<ClimateEntityCapabilityAttribute.MAX_TEMP: 'max_temp'>: 30.0,
<ClimateEntityCapabilityAttribute.MIN_TEMP: 'min_temp'>: 15.0,
<ClimateEntityCapabilityAttribute.TARGET_TEMP_STEP: 'target_temp_step'>: 0.5,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'climate',
'entity_category': None,
'entity_id': 'climate.dorm_1',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': None,
'platform': 'airzone',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': <ClimateEntityFeature: 385>,
'translation_key': None,
'unique_id': 'airzone_unique_id_1:3',
'unit_of_measurement': None,
})
# ---
# name: test_airzone_create_climates[climate.dorm_1-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<ClimateEntityStateAttribute.CURRENT_HUMIDITY: 'current_humidity'>: 35,
<ClimateEntityStateAttribute.CURRENT_TEMPERATURE: 'current_temperature'>: 20.8,
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Dorm #1',
<ClimateEntityStateAttribute.HVAC_ACTION: 'hvac_action'>: <HVACAction.IDLE: 'idle'>,
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.OFF: 'off'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.DRY: 'dry'>,
]),
<ClimateEntityCapabilityAttribute.MAX_TEMP: 'max_temp'>: 30.0,
<ClimateEntityCapabilityAttribute.MIN_TEMP: 'min_temp'>: 15.0,
<EntityStateAttribute.SUPPORTED_FEATURES: 'supported_features'>: <ClimateEntityFeature: 385>,
<ClimateEntityCapabilityAttribute.TARGET_TEMP_STEP: 'target_temp_step'>: 0.5,
<ClimateEntityStateAttribute.TARGET_TEMPERATURE: 'temperature'>: 19.3,
}),
'context': <ANY>,
'entity_id': 'climate.dorm_1',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'heat',
})
# ---
# name: test_airzone_create_climates[climate.dorm_2-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.OFF: 'off'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.DRY: 'dry'>,
]),
<ClimateEntityCapabilityAttribute.MAX_TEMP: 'max_temp'>: 30.0,
<ClimateEntityCapabilityAttribute.MIN_TEMP: 'min_temp'>: 15.0,
<ClimateEntityCapabilityAttribute.TARGET_TEMP_STEP: 'target_temp_step'>: 0.5,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'climate',
'entity_category': None,
'entity_id': 'climate.dorm_2',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': None,
'platform': 'airzone',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': <ClimateEntityFeature: 385>,
'translation_key': None,
'unique_id': 'airzone_unique_id_1:5',
'unit_of_measurement': None,
})
# ---
# name: test_airzone_create_climates[climate.dorm_2-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<ClimateEntityStateAttribute.CURRENT_HUMIDITY: 'current_humidity'>: 40,
<ClimateEntityStateAttribute.CURRENT_TEMPERATURE: 'current_temperature'>: 20.5,
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Dorm #2',
<ClimateEntityStateAttribute.HVAC_ACTION: 'hvac_action'>: <HVACAction.OFF: 'off'>,
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.OFF: 'off'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.DRY: 'dry'>,
]),
<ClimateEntityCapabilityAttribute.MAX_TEMP: 'max_temp'>: 30.0,
<ClimateEntityCapabilityAttribute.MIN_TEMP: 'min_temp'>: 15.0,
<EntityStateAttribute.SUPPORTED_FEATURES: 'supported_features'>: <ClimateEntityFeature: 385>,
<ClimateEntityCapabilityAttribute.TARGET_TEMP_STEP: 'target_temp_step'>: 0.5,
<ClimateEntityStateAttribute.TARGET_TEMPERATURE: 'temperature'>: 19.5,
}),
'context': <ANY>,
'entity_id': 'climate.dorm_2',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_airzone_create_climates[climate.dorm_ppal-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
<ClimateEntityCapabilityAttribute.FAN_MODES: 'fan_modes'>: list([
'auto',
'low',
'high',
]),
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.OFF: 'off'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.DRY: 'dry'>,
]),
<ClimateEntityCapabilityAttribute.MAX_TEMP: 'max_temp'>: 30.0,
<ClimateEntityCapabilityAttribute.MIN_TEMP: 'min_temp'>: 15.0,
<ClimateEntityCapabilityAttribute.TARGET_TEMP_STEP: 'target_temp_step'>: 0.5,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'climate',
'entity_category': None,
'entity_id': 'climate.dorm_ppal',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': None,
'platform': 'airzone',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': <ClimateEntityFeature: 393>,
'translation_key': None,
'unique_id': 'airzone_unique_id_1:2',
'unit_of_measurement': None,
})
# ---
# name: test_airzone_create_climates[climate.dorm_ppal-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<ClimateEntityStateAttribute.CURRENT_HUMIDITY: 'current_humidity'>: 39,
<ClimateEntityStateAttribute.CURRENT_TEMPERATURE: 'current_temperature'>: 21.1,
<ClimateEntityStateAttribute.FAN_MODE: 'fan_mode'>: 'auto',
<ClimateEntityCapabilityAttribute.FAN_MODES: 'fan_modes'>: list([
'auto',
'low',
'high',
]),
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Dorm Ppal',
<ClimateEntityStateAttribute.HVAC_ACTION: 'hvac_action'>: <HVACAction.HEATING: 'heating'>,
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.OFF: 'off'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.DRY: 'dry'>,
]),
<ClimateEntityCapabilityAttribute.MAX_TEMP: 'max_temp'>: 30.0,
<ClimateEntityCapabilityAttribute.MIN_TEMP: 'min_temp'>: 15.0,
<EntityStateAttribute.SUPPORTED_FEATURES: 'supported_features'>: <ClimateEntityFeature: 393>,
<ClimateEntityCapabilityAttribute.TARGET_TEMP_STEP: 'target_temp_step'>: 0.5,
<ClimateEntityStateAttribute.TARGET_TEMPERATURE: 'temperature'>: 19.2,
}),
'context': <ANY>,
'entity_id': 'climate.dorm_ppal',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'heat',
})
# ---
# name: test_airzone_create_climates[climate.salon-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
<ClimateEntityCapabilityAttribute.FAN_MODES: 'fan_modes'>: list([
'auto',
'low',
'medium',
'high',
]),
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.OFF: 'off'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.DRY: 'dry'>,
]),
<ClimateEntityCapabilityAttribute.MAX_TEMP: 'max_temp'>: 30.0,
<ClimateEntityCapabilityAttribute.MIN_TEMP: 'min_temp'>: 15.0,
<ClimateEntityCapabilityAttribute.TARGET_TEMP_STEP: 'target_temp_step'>: 1.0,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'climate',
'entity_category': None,
'entity_id': 'climate.salon',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': None,
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': None,
'platform': 'airzone',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': <ClimateEntityFeature: 393>,
'translation_key': None,
'unique_id': 'airzone_unique_id_1:1',
'unit_of_measurement': None,
})
# ---
# name: test_airzone_create_climates[climate.salon-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<ClimateEntityStateAttribute.CURRENT_HUMIDITY: 'current_humidity'>: 34,
<ClimateEntityStateAttribute.CURRENT_TEMPERATURE: 'current_temperature'>: 19.6,
<ClimateEntityStateAttribute.FAN_MODE: 'fan_mode'>: 'auto',
<ClimateEntityCapabilityAttribute.FAN_MODES: 'fan_modes'>: list([
'auto',
'low',
'medium',
'high',
]),
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Salon',
<ClimateEntityStateAttribute.HVAC_ACTION: 'hvac_action'>: <HVACAction.OFF: 'off'>,
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.OFF: 'off'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.DRY: 'dry'>,
]),
<ClimateEntityCapabilityAttribute.MAX_TEMP: 'max_temp'>: 30.0,
<ClimateEntityCapabilityAttribute.MIN_TEMP: 'min_temp'>: 15.0,
<EntityStateAttribute.SUPPORTED_FEATURES: 'supported_features'>: <ClimateEntityFeature: 393>,
<ClimateEntityCapabilityAttribute.TARGET_TEMP_STEP: 'target_temp_step'>: 1.0,
<ClimateEntityStateAttribute.TARGET_TEMPERATURE: 'temperature'>: 19.1,
}),
'context': <ANY>,
'entity_id': 'climate.salon',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
File diff suppressed because it is too large Load Diff
+35 -193
View File
@@ -1,5 +1,6 @@
"""The climate tests for the Airzone platform."""
from collections.abc import Generator
import copy
from unittest.mock import patch
@@ -18,30 +19,21 @@ from aioairzone.const import (
)
from aioairzone.exceptions import AirzoneError
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.airzone.coordinator import SCAN_INTERVAL
from homeassistant.components.climate import (
ATTR_CURRENT_HUMIDITY,
ATTR_CURRENT_TEMPERATURE,
ATTR_FAN_MODE,
ATTR_FAN_MODES,
ATTR_HVAC_ACTION,
ATTR_HVAC_MODE,
ATTR_HVAC_MODES,
ATTR_MAX_TEMP,
ATTR_MIN_TEMP,
ATTR_TARGET_TEMP_HIGH,
ATTR_TARGET_TEMP_LOW,
ATTR_TARGET_TEMP_STEP,
DOMAIN as CLIMATE_DOMAIN,
FAN_AUTO,
FAN_HIGH,
FAN_LOW,
FAN_MEDIUM,
SERVICE_SET_FAN_MODE,
SERVICE_SET_HVAC_MODE,
SERVICE_SET_TEMPERATURE,
HVACAction,
ClimateEntityCapabilityAttribute,
ClimateEntityStateAttribute,
HVACMode,
)
from homeassistant.const import (
@@ -49,9 +41,11 @@ from homeassistant.const import (
ATTR_TEMPERATURE,
SERVICE_TURN_OFF,
SERVICE_TURN_ON,
Platform,
)
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import entity_registry as er
from homeassistant.util.dt import utcnow
from .util import (
@@ -62,185 +56,33 @@ from .util import (
async_init_integration,
)
from tests.common import async_fire_time_changed
from tests.common import async_fire_time_changed, snapshot_platform
async def test_airzone_create_climates(hass: HomeAssistant) -> None:
@pytest.fixture(autouse=True)
def override_platforms() -> Generator[None]:
"""Override PLATFORMS."""
with patch("homeassistant.components.airzone.PLATFORMS", [Platform.CLIMATE]):
yield
async def test_airzone_create_climates(
hass: HomeAssistant,
entity_registry: er.EntityRegistry,
snapshot: SnapshotAssertion,
) -> None:
"""Test creation of climates."""
config_entry = await async_init_integration(hass)
await snapshot_platform(hass, entity_registry, snapshot, config_entry.entry_id)
async def test_airzone_climate_update_temp_limits(hass: HomeAssistant) -> None:
"""Test climate temperature limits are refreshed from the API."""
await async_init_integration(hass)
state = hass.states.get("climate.despacho")
assert state.state == HVACMode.OFF
assert state.attributes.get(ATTR_CURRENT_HUMIDITY) == 36
assert state.attributes.get(ATTR_CURRENT_TEMPERATURE) == 21.2
assert state.attributes.get(ATTR_FAN_MODE) is None
assert state.attributes.get(ATTR_FAN_MODES) is None
assert state.attributes.get(ATTR_HVAC_ACTION) == HVACAction.OFF
assert state.attributes.get(ATTR_HVAC_MODES) == [
HVACMode.OFF,
HVACMode.FAN_ONLY,
HVACMode.COOL,
HVACMode.HEAT,
HVACMode.DRY,
]
assert state.attributes.get(ATTR_MAX_TEMP) == 30
assert state.attributes.get(ATTR_MIN_TEMP) == 15
assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == 1.0
assert state.attributes.get(ATTR_TEMPERATURE) == 19.4
state = hass.states.get("climate.dorm_1")
assert state.state == HVACMode.HEAT
assert state.attributes.get(ATTR_CURRENT_HUMIDITY) == 35
assert state.attributes.get(ATTR_CURRENT_TEMPERATURE) == 20.8
assert state.attributes.get(ATTR_FAN_MODE) is None
assert state.attributes.get(ATTR_FAN_MODES) is None
assert state.attributes.get(ATTR_HVAC_ACTION) == HVACAction.IDLE
assert state.attributes.get(ATTR_HVAC_MODES) == [
HVACMode.OFF,
HVACMode.FAN_ONLY,
HVACMode.COOL,
HVACMode.HEAT,
HVACMode.DRY,
]
assert state.attributes.get(ATTR_MAX_TEMP) == 30
assert state.attributes.get(ATTR_MIN_TEMP) == 15
assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == 0.5
assert state.attributes.get(ATTR_TEMPERATURE) == 19.3
state = hass.states.get("climate.dorm_2")
assert state.state == HVACMode.OFF
assert state.attributes.get(ATTR_CURRENT_HUMIDITY) == 40
assert state.attributes.get(ATTR_CURRENT_TEMPERATURE) == 20.5
assert state.attributes.get(ATTR_FAN_MODE) is None
assert state.attributes.get(ATTR_FAN_MODES) is None
assert state.attributes.get(ATTR_HVAC_ACTION) == HVACAction.OFF
assert state.attributes.get(ATTR_HVAC_MODES) == [
HVACMode.OFF,
HVACMode.FAN_ONLY,
HVACMode.COOL,
HVACMode.HEAT,
HVACMode.DRY,
]
assert state.attributes.get(ATTR_MAX_TEMP) == 30
assert state.attributes.get(ATTR_MIN_TEMP) == 15
assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == 0.5
assert state.attributes.get(ATTR_TEMPERATURE) == 19.5
state = hass.states.get("climate.dorm_ppal")
assert state.state == HVACMode.HEAT
assert state.attributes.get(ATTR_CURRENT_HUMIDITY) == 39
assert state.attributes.get(ATTR_CURRENT_TEMPERATURE) == 21.1
assert state.attributes.get(ATTR_FAN_MODE) == FAN_AUTO
assert state.attributes.get(ATTR_FAN_MODES) == [
FAN_AUTO,
FAN_LOW,
FAN_HIGH,
]
assert state.attributes.get(ATTR_HVAC_ACTION) == HVACAction.HEATING
assert state.attributes.get(ATTR_HVAC_MODES) == [
HVACMode.OFF,
HVACMode.FAN_ONLY,
HVACMode.COOL,
HVACMode.HEAT,
HVACMode.DRY,
]
assert state.attributes.get(ATTR_MAX_TEMP) == 30
assert state.attributes.get(ATTR_MIN_TEMP) == 15
assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == 0.5
assert state.attributes.get(ATTR_TEMPERATURE) == 19.2
state = hass.states.get("climate.salon")
assert state.state == HVACMode.OFF
assert state.attributes.get(ATTR_CURRENT_HUMIDITY) == 34
assert state.attributes.get(ATTR_CURRENT_TEMPERATURE) == 19.6
assert state.attributes.get(ATTR_FAN_MODE) == FAN_AUTO
assert state.attributes.get(ATTR_FAN_MODES) == [
FAN_AUTO,
FAN_LOW,
FAN_MEDIUM,
FAN_HIGH,
]
assert state.attributes.get(ATTR_HVAC_ACTION) == HVACAction.OFF
assert state.attributes.get(ATTR_HVAC_MODES) == [
HVACMode.OFF,
HVACMode.FAN_ONLY,
HVACMode.COOL,
HVACMode.HEAT,
HVACMode.DRY,
]
assert state.attributes.get(ATTR_MAX_TEMP) == 30
assert state.attributes.get(ATTR_MIN_TEMP) == 15
assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == 1.0
assert state.attributes.get(ATTR_TEMPERATURE) == 19.1
state = hass.states.get("climate.airzone_2_1")
assert state.state == HVACMode.OFF
assert state.attributes.get(ATTR_CURRENT_HUMIDITY) == 62
assert state.attributes.get(ATTR_CURRENT_TEMPERATURE) == 22.3
assert state.attributes.get(ATTR_FAN_MODE) == FAN_AUTO
assert state.attributes.get(ATTR_FAN_MODES) == [
FAN_AUTO,
FAN_LOW,
FAN_MEDIUM,
"75%",
FAN_HIGH,
]
assert state.attributes.get(ATTR_HVAC_ACTION) == HVACAction.OFF
assert state.attributes.get(ATTR_HVAC_MODES) == [
HVACMode.HEAT_COOL,
HVACMode.OFF,
]
assert state.attributes.get(ATTR_MAX_TEMP) == 30
assert state.attributes.get(ATTR_MIN_TEMP) == 15
assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == 0.5
assert state.attributes.get(ATTR_TEMPERATURE) == 19.0
state = hass.states.get("climate.dkn_plus")
assert state.state == HVACMode.HEAT_COOL
assert state.attributes.get(ATTR_CURRENT_HUMIDITY) is None
assert state.attributes.get(ATTR_CURRENT_TEMPERATURE) == 21.7
assert state.attributes.get(ATTR_FAN_MODE) == "40%"
assert state.attributes.get(ATTR_FAN_MODES) == [
FAN_AUTO,
FAN_LOW,
"40%",
FAN_MEDIUM,
"80%",
FAN_HIGH,
]
assert state.attributes.get(ATTR_HVAC_ACTION) == HVACAction.COOLING
assert state.attributes.get(ATTR_HVAC_MODES) == [
HVACMode.FAN_ONLY,
HVACMode.COOL,
HVACMode.HEAT,
HVACMode.DRY,
HVACMode.HEAT_COOL,
HVACMode.OFF,
]
assert state.attributes.get(ATTR_MAX_TEMP) == 32.2
assert state.attributes.get(ATTR_MIN_TEMP) == 17.8
assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == 1.0
assert state.attributes.get(ATTR_TARGET_TEMP_HIGH) == 25.0
assert state.attributes.get(ATTR_TARGET_TEMP_LOW) == 22.8
state = hass.states.get("climate.aux_heat")
assert state.state == HVACMode.HEAT
assert state.attributes.get(ATTR_CURRENT_HUMIDITY) is None
assert state.attributes.get(ATTR_CURRENT_TEMPERATURE) == 22
assert state.attributes.get(ATTR_HVAC_ACTION) == HVACAction.IDLE
assert state.attributes.get(ATTR_HVAC_MODES) == [
HVACMode.OFF,
HVACMode.COOL,
HVACMode.HEAT,
HVACMode.FAN_ONLY,
HVACMode.DRY,
]
assert state.attributes.get(ATTR_MAX_TEMP) == 30
assert state.attributes.get(ATTR_MIN_TEMP) == 15
assert state.attributes.get(ATTR_TARGET_TEMP_STEP) == 0.5
assert state.attributes.get(ATTR_TEMPERATURE) == 20.0
HVAC_MOCK_CHANGED = copy.deepcopy(HVAC_MOCK)
HVAC_MOCK_CHANGED[API_SYSTEMS][0][API_DATA][0][API_MAX_TEMP] = 25
HVAC_MOCK_CHANGED[API_SYSTEMS][0][API_DATA][0][API_MIN_TEMP] = 10
@@ -267,8 +109,8 @@ async def test_airzone_create_climates(hass: HomeAssistant) -> None:
await hass.async_block_till_done(wait_background_tasks=True)
state = hass.states.get("climate.salon")
assert state.attributes.get(ATTR_MAX_TEMP) == 25
assert state.attributes.get(ATTR_MIN_TEMP) == 10
assert state.attributes.get(ClimateEntityCapabilityAttribute.MAX_TEMP) == 25
assert state.attributes.get(ClimateEntityCapabilityAttribute.MIN_TEMP) == 10
async def test_airzone_climate_turn_on_off(hass: HomeAssistant) -> None:
@@ -486,7 +328,7 @@ async def test_airzone_climate_set_hvac_mode(hass: HomeAssistant) -> None:
await hass.async_block_till_done()
state = hass.states.get("climate.salon")
assert state.attributes.get(ATTR_TEMPERATURE) == 19.1
assert state.attributes.get(ClimateEntityStateAttribute.TARGET_TEMPERATURE) == 19.1
async def test_airzone_climate_set_hvac_slave_error(hass: HomeAssistant) -> None:
@@ -555,7 +397,7 @@ async def test_airzone_climate_set_fan_mode(hass: HomeAssistant) -> None:
)
state = hass.states.get("climate.salon")
assert state.attributes.get(ATTR_FAN_MODE) == FAN_MEDIUM
assert state.attributes.get(ClimateEntityStateAttribute.FAN_MODE) == FAN_MEDIUM
async def test_airzone_climate_set_temp(hass: HomeAssistant) -> None:
@@ -591,7 +433,7 @@ async def test_airzone_climate_set_temp(hass: HomeAssistant) -> None:
state = hass.states.get("climate.dorm_2")
assert state.state == HVACMode.HEAT
assert state.attributes.get(ATTR_TEMPERATURE) == 20.5
assert state.attributes.get(ClimateEntityStateAttribute.TARGET_TEMPERATURE) == 20.5
async def test_airzone_climate_set_temp_error(hass: HomeAssistant) -> None:
@@ -617,7 +459,7 @@ async def test_airzone_climate_set_temp_error(hass: HomeAssistant) -> None:
)
state = hass.states.get("climate.dorm_2")
assert state.attributes.get(ATTR_TEMPERATURE) == 19.5
assert state.attributes.get(ClimateEntityStateAttribute.TARGET_TEMPERATURE) == 19.5
async def test_airzone_climate_set_temp_range(hass: HomeAssistant) -> None:
@@ -652,5 +494,5 @@ async def test_airzone_climate_set_temp_range(hass: HomeAssistant) -> None:
)
state = hass.states.get("climate.dkn_plus")
assert state.attributes.get(ATTR_TARGET_TEMP_HIGH) == 25.0
assert state.attributes.get(ATTR_TARGET_TEMP_LOW) == 20.0
assert state.attributes.get(ClimateEntityStateAttribute.TARGET_TEMP_HIGH) == 25.0
assert state.attributes.get(ClimateEntityStateAttribute.TARGET_TEMP_LOW) == 20.0
+31 -74
View File
@@ -1,5 +1,6 @@
"""The select tests for the Airzone platform."""
from collections.abc import Generator
from unittest.mock import patch
from aioairzone.common import OperationMode, QAdapt
@@ -14,91 +15,47 @@ from aioairzone.const import (
API_ZONE_ID,
)
import pytest
from syrupy.assertion import SnapshotAssertion
from homeassistant.components.select import ATTR_OPTIONS, DOMAIN as SELECT_DOMAIN
from homeassistant.const import ATTR_ENTITY_ID, ATTR_OPTION, SERVICE_SELECT_OPTION
from homeassistant.components.select import DOMAIN as SELECT_DOMAIN
from homeassistant.const import (
ATTR_ENTITY_ID,
ATTR_OPTION,
SERVICE_SELECT_OPTION,
Platform,
)
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError, ServiceValidationError
from homeassistant.helpers import entity_registry as er
from .util import async_init_integration
from tests.common import snapshot_platform
async def test_airzone_create_selects(hass: HomeAssistant) -> None:
@pytest.fixture(autouse=True)
def override_platforms() -> Generator[None]:
"""Override PLATFORMS."""
with patch("homeassistant.components.airzone.PLATFORMS", [Platform.SELECT]):
yield
async def test_airzone_create_selects(
hass: HomeAssistant,
entity_registry: er.EntityRegistry,
snapshot: SnapshotAssertion,
) -> None:
"""Test creation of selects."""
await async_init_integration(hass)
config_entry = await async_init_integration(hass)
# Systems
state = hass.states.get("select.system_1_q_adapt")
assert state.state == "standard"
await snapshot_platform(hass, entity_registry, snapshot, config_entry.entry_id)
# Zones
state = hass.states.get("select.despacho_cold_angle")
assert state.state == "90deg"
state = hass.states.get("select.despacho_heat_angle")
assert state.state == "90deg"
state = hass.states.get("select.despacho_mode")
assert state is None
state = hass.states.get("select.despacho_sleep")
assert state.state == "off"
state = hass.states.get("select.dorm_1_cold_angle")
assert state.state == "90deg"
state = hass.states.get("select.dorm_1_heat_angle")
assert state.state == "90deg"
state = hass.states.get("select.dorm_1_mode")
assert state is None
state = hass.states.get("select.dorm_1_sleep")
assert state.state == "off"
state = hass.states.get("select.dorm_2_cold_angle")
assert state.state == "90deg"
state = hass.states.get("select.dorm_2_heat_angle")
assert state.state == "90deg"
state = hass.states.get("select.dorm_2_mode")
assert state is None
state = hass.states.get("select.dorm_2_sleep")
assert state.state == "off"
state = hass.states.get("select.dorm_ppal_cold_angle")
assert state.state == "45deg"
state = hass.states.get("select.dorm_ppal_heat_angle")
assert state.state == "50deg"
state = hass.states.get("select.dorm_ppal_mode")
assert state is None
state = hass.states.get("select.dorm_ppal_sleep")
assert state.state == "30m"
state = hass.states.get("select.salon_cold_angle")
assert state.state == "90deg"
state = hass.states.get("select.salon_heat_angle")
assert state.state == "90deg"
state = hass.states.get("select.salon_mode")
assert state.state == "heat"
assert state.attributes.get(ATTR_OPTIONS) == [
"cool",
"dry",
"fan",
"heat",
"stop",
]
state = hass.states.get("select.salon_sleep")
assert state.state == "off"
# Mode selects are only created for master zones
assert hass.states.get("select.despacho_mode") is None
assert hass.states.get("select.dorm_1_mode") is None
assert hass.states.get("select.dorm_2_mode") is None
assert hass.states.get("select.dorm_ppal_mode") is None
async def test_airzone_select_sys_qadapt(hass: HomeAssistant) -> None: