Use snapshot_platform in airzone_cloud (#181728)

This commit is contained in:
epenet
2026-09-09 15:36:29 +02:00
committed by GitHub
parent a42199d6fe
commit b69a9a5310
5 changed files with 740 additions and 178 deletions
@@ -0,0 +1,491 @@
# serializer version: 1
# name: test_airzone_create_climates[climate.bron-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
<ClimateEntityCapabilityAttribute.FAN_MODES: 'fan_modes'>: list([
'low',
'medium',
'high',
]),
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.DRY: 'dry'>,
<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.bron',
'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_cloud',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': <ClimateEntityFeature: 393>,
'translation_key': None,
'unique_id': 'aidoo1',
'unit_of_measurement': None,
})
# ---
# name: test_airzone_create_climates[climate.bron-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<ClimateEntityStateAttribute.CURRENT_TEMPERATURE: 'current_temperature'>: 21.0,
<ClimateEntityStateAttribute.FAN_MODE: 'fan_mode'>: 'high',
<ClimateEntityCapabilityAttribute.FAN_MODES: 'fan_modes'>: list([
'low',
'medium',
'high',
]),
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Bron',
<ClimateEntityStateAttribute.HVAC_ACTION: 'hvac_action'>: <HVACAction.OFF: 'off'>,
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.DRY: 'dry'>,
<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'>: 22.0,
}),
'context': <ANY>,
'entity_id': 'climate.bron',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_airzone_create_climates[climate.bron_pro-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
<ClimateEntityCapabilityAttribute.FAN_MODES: 'fan_modes'>: list([
'auto',
'20%',
'40%',
'60%',
'80%',
'100%',
]),
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.DRY: 'dry'>,
<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.bron_pro',
'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_cloud',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': <ClimateEntityFeature: 395>,
'translation_key': None,
'unique_id': 'aidoo_pro',
'unit_of_measurement': None,
})
# ---
# name: test_airzone_create_climates[climate.bron_pro-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<ClimateEntityStateAttribute.CURRENT_TEMPERATURE: 'current_temperature'>: 20.0,
<ClimateEntityStateAttribute.FAN_MODE: 'fan_mode'>: '60%',
<ClimateEntityCapabilityAttribute.FAN_MODES: 'fan_modes'>: list([
'auto',
'20%',
'40%',
'60%',
'80%',
'100%',
]),
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Bron Pro',
<ClimateEntityStateAttribute.HVAC_ACTION: 'hvac_action'>: <HVACAction.COOLING: 'cooling'>,
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.OFF: 'off'>,
]),
<ClimateEntityCapabilityAttribute.MAX_TEMP: 'max_temp'>: 30.0,
<ClimateEntityCapabilityAttribute.MIN_TEMP: 'min_temp'>: 15.0,
<EntityStateAttribute.SUPPORTED_FEATURES: 'supported_features'>: <ClimateEntityFeature: 395>,
<ClimateEntityStateAttribute.TARGET_TEMP_HIGH: 'target_temp_high'>: None,
<ClimateEntityStateAttribute.TARGET_TEMP_LOW: 'target_temp_low'>: None,
<ClimateEntityCapabilityAttribute.TARGET_TEMP_STEP: 'target_temp_step'>: 0.5,
<ClimateEntityStateAttribute.TARGET_TEMPERATURE: 'temperature'>: 22.0,
}),
'context': <ANY>,
'entity_id': 'climate.bron_pro',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'cool',
})
# ---
# name: test_airzone_create_climates[climate.dormitorio-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.DRY: 'dry'>,
<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.dormitorio',
'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_cloud',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': <ClimateEntityFeature: 385>,
'translation_key': None,
'unique_id': 'zone2',
'unit_of_measurement': None,
})
# ---
# name: test_airzone_create_climates[climate.dormitorio-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<ClimateEntityStateAttribute.CURRENT_HUMIDITY: 'current_humidity'>: 24,
<ClimateEntityStateAttribute.CURRENT_TEMPERATURE: 'current_temperature'>: 25.0,
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Dormitorio',
<ClimateEntityStateAttribute.HVAC_ACTION: 'hvac_action'>: <HVACAction.OFF: 'off'>,
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.OFF: 'off'>,
]),
<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'>: 24.0,
}),
'context': <ANY>,
'entity_id': 'climate.dormitorio',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'off',
})
# ---
# name: test_airzone_create_climates[climate.group-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.DRY: 'dry'>,
<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.group',
'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_cloud',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': <ClimateEntityFeature: 385>,
'translation_key': None,
'unique_id': 'grp1',
'unit_of_measurement': None,
})
# ---
# name: test_airzone_create_climates[climate.group-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<ClimateEntityStateAttribute.CURRENT_HUMIDITY: 'current_humidity'>: 27,
<ClimateEntityStateAttribute.CURRENT_TEMPERATURE: 'current_temperature'>: 22.5,
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Group',
<ClimateEntityStateAttribute.HVAC_ACTION: 'hvac_action'>: <HVACAction.COOLING: 'cooling'>,
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.OFF: 'off'>,
]),
<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'>: 24.0,
}),
'context': <ANY>,
'entity_id': 'climate.group',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'cool',
})
# ---
# name: test_airzone_create_climates[climate.house-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.DRY: 'dry'>,
<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.house',
'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_cloud',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': <ClimateEntityFeature: 385>,
'translation_key': None,
'unique_id': 'inst1',
'unit_of_measurement': None,
})
# ---
# name: test_airzone_create_climates[climate.house-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<ClimateEntityStateAttribute.CURRENT_HUMIDITY: 'current_humidity'>: 27,
<ClimateEntityStateAttribute.CURRENT_TEMPERATURE: 'current_temperature'>: 21.5,
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'House',
<ClimateEntityStateAttribute.HVAC_ACTION: 'hvac_action'>: <HVACAction.COOLING: 'cooling'>,
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.HEAT_COOL: 'heat_cool'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.OFF: 'off'>,
]),
<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'>: 23.0,
}),
'context': <ANY>,
'entity_id': 'climate.house',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'cool',
})
# ---
# name: test_airzone_create_climates[climate.salon-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.DRY: 'dry'>,
<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.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_cloud',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': <ClimateEntityFeature: 385>,
'translation_key': None,
'unique_id': 'zone1',
'unit_of_measurement': None,
})
# ---
# name: test_airzone_create_climates[climate.salon-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<ClimateEntityStateAttribute.CURRENT_HUMIDITY: 'current_humidity'>: 30,
<ClimateEntityStateAttribute.CURRENT_TEMPERATURE: 'current_temperature'>: 20.0,
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Salon',
<ClimateEntityStateAttribute.HVAC_ACTION: 'hvac_action'>: <HVACAction.COOLING: 'cooling'>,
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.FAN_ONLY: 'fan_only'>,
<HVACMode.DRY: 'dry'>,
<HVACMode.OFF: 'off'>,
]),
<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'>: 24.0,
}),
'context': <ANY>,
'entity_id': 'climate.salon',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'cool',
})
# ---
@@ -0,0 +1,186 @@
# serializer version: 1
# name: test_airzone_create_selects[select.dormitorio_air_quality_mode-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
<SelectEntityCapabilityAttribute.OPTIONS: 'options'>: list([
'off',
'on',
'auto',
]),
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'select',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'select.dormitorio_air_quality_mode',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Air Quality mode',
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Air Quality mode',
'platform': 'airzone_cloud',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'air_quality',
'unique_id': 'zone2_aq-mode-conf',
'unit_of_measurement': None,
})
# ---
# name: test_airzone_create_selects[select.dormitorio_air_quality_mode-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Dormitorio Air Quality mode',
<SelectEntityCapabilityAttribute.OPTIONS: 'options'>: list([
'off',
'on',
'auto',
]),
}),
'context': <ANY>,
'entity_id': 'select.dormitorio_air_quality_mode',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'auto',
})
# ---
# name: test_airzone_create_selects[select.salon_air_quality_mode-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
<SelectEntityCapabilityAttribute.OPTIONS: 'options'>: list([
'off',
'on',
'auto',
]),
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'select',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'select.salon_air_quality_mode',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Air Quality mode',
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Air Quality mode',
'platform': 'airzone_cloud',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'air_quality',
'unique_id': 'zone1_aq-mode-conf',
'unit_of_measurement': None,
})
# ---
# name: test_airzone_create_selects[select.salon_air_quality_mode-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Salon Air Quality mode',
<SelectEntityCapabilityAttribute.OPTIONS: 'options'>: list([
'off',
'on',
'auto',
]),
}),
'context': <ANY>,
'entity_id': 'select.salon_air_quality_mode',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'auto',
})
# ---
# name: test_airzone_create_selects[select.salon_mode-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
<SelectEntityCapabilityAttribute.OPTIONS: 'options'>: list([
'cool',
'dry',
'fan',
'heat',
]),
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'select',
'entity_category': None,
'entity_id': 'select.salon_mode',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Mode',
'options': dict({
}),
'original_device_class': None,
'original_icon': None,
'original_name': 'Mode',
'platform': 'airzone_cloud',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'modes',
'unique_id': 'zone1_mode',
'unit_of_measurement': None,
})
# ---
# name: test_airzone_create_selects[select.salon_mode-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Salon Mode',
<SelectEntityCapabilityAttribute.OPTIONS: 'options'>: list([
'cool',
'dry',
'fan',
'heat',
]),
}),
'context': <ANY>,
'entity_id': 'select.salon_mode',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'cool',
})
# ---
+32 -156
View File
@@ -1,33 +1,24 @@
"""The climate tests for the Airzone Cloud platform."""
from collections.abc import Generator
from unittest.mock import patch
from aioairzone_cloud.const import API_DEFAULT_TEMP_STEP
from aioairzone_cloud.exceptions import AirzoneCloudError
import pytest
from syrupy.assertion import SnapshotAssertion
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,
ClimateEntityStateAttribute,
HVACMode,
)
from homeassistant.const import (
@@ -35,149 +26,34 @@ 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 .util import async_init_integration
from tests.common import 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_cloud.PLATFORMS", [Platform.CLIMATE]):
yield
async def test_airzone_create_climates(
hass: HomeAssistant,
entity_registry: er.EntityRegistry,
snapshot: SnapshotAssertion,
) -> None:
"""Test creation of climates."""
await async_init_integration(hass)
config_entry = await async_init_integration(hass)
# Aidoos
state = hass.states.get("climate.bron")
assert state.state == HVACMode.OFF
assert ATTR_CURRENT_HUMIDITY not in state.attributes
assert state.attributes[ATTR_CURRENT_TEMPERATURE] == 21.0
assert state.attributes[ATTR_FAN_MODE] == FAN_HIGH
assert state.attributes[ATTR_FAN_MODES] == [
FAN_LOW,
FAN_MEDIUM,
FAN_HIGH,
]
assert state.attributes[ATTR_HVAC_ACTION] == HVACAction.OFF
assert state.attributes[ATTR_HVAC_MODES] == [
HVACMode.HEAT_COOL,
HVACMode.COOL,
HVACMode.HEAT,
HVACMode.FAN_ONLY,
HVACMode.DRY,
HVACMode.OFF,
]
assert state.attributes[ATTR_MAX_TEMP] == 30
assert state.attributes[ATTR_MIN_TEMP] == 15
assert state.attributes[ATTR_TARGET_TEMP_STEP] == API_DEFAULT_TEMP_STEP
assert state.attributes[ATTR_TEMPERATURE] == 22.0
state = hass.states.get("climate.bron_pro")
assert state.state == HVACMode.COOL
assert ATTR_CURRENT_HUMIDITY not in state.attributes
assert state.attributes[ATTR_CURRENT_TEMPERATURE] == 20.0
assert state.attributes[ATTR_FAN_MODE] == "60%"
assert state.attributes[ATTR_FAN_MODES] == [
FAN_AUTO,
"20%",
"40%",
"60%",
"80%",
"100%",
]
assert state.attributes[ATTR_HVAC_ACTION] == HVACAction.COOLING
assert state.attributes[ATTR_HVAC_MODES] == [
HVACMode.HEAT_COOL,
HVACMode.COOL,
HVACMode.HEAT,
HVACMode.FAN_ONLY,
HVACMode.DRY,
HVACMode.OFF,
]
assert state.attributes[ATTR_MAX_TEMP] == 30
assert state.attributes[ATTR_MIN_TEMP] == 15
assert state.attributes[ATTR_TARGET_TEMP_STEP] == API_DEFAULT_TEMP_STEP
assert state.attributes.get(ATTR_TEMPERATURE) == 22.0
# Groups
state = hass.states.get("climate.group")
assert state.state == HVACMode.COOL
assert state.attributes[ATTR_CURRENT_HUMIDITY] == 27
assert state.attributes[ATTR_CURRENT_TEMPERATURE] == 22.5
assert ATTR_FAN_MODE not in state.attributes
assert ATTR_FAN_MODES not in state.attributes
assert state.attributes[ATTR_HVAC_ACTION] == HVACAction.COOLING
assert state.attributes[ATTR_HVAC_MODES] == [
HVACMode.COOL,
HVACMode.HEAT,
HVACMode.FAN_ONLY,
HVACMode.DRY,
HVACMode.OFF,
]
assert state.attributes[ATTR_MAX_TEMP] == 30
assert state.attributes[ATTR_MIN_TEMP] == 15
assert state.attributes[ATTR_TARGET_TEMP_STEP] == API_DEFAULT_TEMP_STEP
assert state.attributes[ATTR_TEMPERATURE] == 24.0
# Installations
state = hass.states.get("climate.house")
assert state.state == HVACMode.COOL
assert state.attributes[ATTR_CURRENT_HUMIDITY] == 27
assert state.attributes[ATTR_CURRENT_TEMPERATURE] == 21.5
assert ATTR_FAN_MODE not in state.attributes
assert ATTR_FAN_MODES not in state.attributes
assert state.attributes[ATTR_HVAC_ACTION] == HVACAction.COOLING
assert state.attributes[ATTR_HVAC_MODES] == [
HVACMode.HEAT_COOL,
HVACMode.COOL,
HVACMode.HEAT,
HVACMode.FAN_ONLY,
HVACMode.DRY,
HVACMode.OFF,
]
assert state.attributes[ATTR_MAX_TEMP] == 30
assert state.attributes[ATTR_MIN_TEMP] == 15
assert state.attributes[ATTR_TARGET_TEMP_STEP] == API_DEFAULT_TEMP_STEP
assert state.attributes[ATTR_TEMPERATURE] == 23.0
# Zones
state = hass.states.get("climate.dormitorio")
assert state.state == HVACMode.OFF
assert state.attributes[ATTR_CURRENT_HUMIDITY] == 24
assert state.attributes[ATTR_CURRENT_TEMPERATURE] == 25.0
assert ATTR_FAN_MODE not in state.attributes
assert ATTR_FAN_MODES not in state.attributes
assert state.attributes[ATTR_HVAC_ACTION] == HVACAction.OFF
assert state.attributes[ATTR_HVAC_MODES] == [
HVACMode.COOL,
HVACMode.HEAT,
HVACMode.FAN_ONLY,
HVACMode.DRY,
HVACMode.OFF,
]
assert state.attributes[ATTR_MAX_TEMP] == 30
assert state.attributes[ATTR_MIN_TEMP] == 15
assert state.attributes[ATTR_TARGET_TEMP_STEP] == API_DEFAULT_TEMP_STEP
assert state.attributes[ATTR_TEMPERATURE] == 24.0
state = hass.states.get("climate.salon")
assert state.state == HVACMode.COOL
assert state.attributes[ATTR_CURRENT_HUMIDITY] == 30
assert state.attributes[ATTR_CURRENT_TEMPERATURE] == 20.0
assert ATTR_FAN_MODE not in state.attributes
assert ATTR_FAN_MODES not in state.attributes
assert state.attributes[ATTR_HVAC_ACTION] == HVACAction.COOLING
assert state.attributes[ATTR_HVAC_MODES] == [
HVACMode.COOL,
HVACMode.HEAT,
HVACMode.FAN_ONLY,
HVACMode.DRY,
HVACMode.OFF,
]
assert state.attributes[ATTR_MAX_TEMP] == 30
assert state.attributes[ATTR_MIN_TEMP] == 15
assert state.attributes[ATTR_TARGET_TEMP_STEP] == API_DEFAULT_TEMP_STEP
assert state.attributes[ATTR_TEMPERATURE] == 24.0
await snapshot_platform(hass, entity_registry, snapshot, config_entry.entry_id)
async def test_airzone_climate_turn_on_off(hass: HomeAssistant) -> None:
@@ -323,7 +199,7 @@ async def test_airzone_climate_set_fan_mode(hass: HomeAssistant) -> None:
)
state = hass.states.get("climate.bron")
assert state.attributes[ATTR_FAN_MODE] == FAN_LOW
assert state.attributes[ClimateEntityStateAttribute.FAN_MODE] == FAN_LOW
with patch(
"homeassistant.components.airzone_cloud.AirzoneCloudApi.api_patch_device",
@@ -340,7 +216,7 @@ async def test_airzone_climate_set_fan_mode(hass: HomeAssistant) -> None:
)
state = hass.states.get("climate.bron_pro")
assert state.attributes[ATTR_FAN_MODE] == FAN_AUTO
assert state.attributes[ClimateEntityStateAttribute.FAN_MODE] == FAN_AUTO
async def test_airzone_climate_set_hvac_mode(hass: HomeAssistant) -> None:
@@ -536,7 +412,7 @@ async def test_airzone_climate_set_temp(hass: HomeAssistant) -> None:
)
state = hass.states.get("climate.group")
assert state.attributes[ATTR_TEMPERATURE] == 20.5
assert state.attributes[ClimateEntityStateAttribute.TARGET_TEMPERATURE] == 20.5
# Installations
with patch(
@@ -556,7 +432,7 @@ async def test_airzone_climate_set_temp(hass: HomeAssistant) -> None:
state = hass.states.get("climate.house")
assert state.state == HVACMode.HEAT
assert state.attributes[ATTR_TEMPERATURE] == 20.5
assert state.attributes[ClimateEntityStateAttribute.TARGET_TEMPERATURE] == 20.5
# Zones
with patch(
@@ -576,7 +452,7 @@ async def test_airzone_climate_set_temp(hass: HomeAssistant) -> None:
state = hass.states.get("climate.salon")
assert state.state == HVACMode.HEAT
assert state.attributes[ATTR_TEMPERATURE] == 20.5
assert state.attributes[ClimateEntityStateAttribute.TARGET_TEMPERATURE] == 20.5
# Aidoo Pro with Double Setpoint
with patch(
@@ -597,8 +473,8 @@ async def test_airzone_climate_set_temp(hass: HomeAssistant) -> None:
state = hass.states.get("climate.bron_pro")
assert state.state == HVACMode.HEAT_COOL
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
async def test_airzone_climate_set_temp_error(hass: HomeAssistant) -> None:
@@ -625,7 +501,7 @@ async def test_airzone_climate_set_temp_error(hass: HomeAssistant) -> None:
)
state = hass.states.get("climate.bron")
assert state.attributes[ATTR_TEMPERATURE] == 22.0
assert state.attributes[ClimateEntityStateAttribute.TARGET_TEMPERATURE] == 22.0
# Groups
with (
@@ -646,7 +522,7 @@ async def test_airzone_climate_set_temp_error(hass: HomeAssistant) -> None:
)
state = hass.states.get("climate.group")
assert state.attributes[ATTR_TEMPERATURE] == 24.0
assert state.attributes[ClimateEntityStateAttribute.TARGET_TEMPERATURE] == 24.0
# Installations
with (
@@ -667,7 +543,7 @@ async def test_airzone_climate_set_temp_error(hass: HomeAssistant) -> None:
)
state = hass.states.get("climate.house")
assert state.attributes[ATTR_TEMPERATURE] == 23.0
assert state.attributes[ClimateEntityStateAttribute.TARGET_TEMPERATURE] == 23.0
# Zones
with (
@@ -688,4 +564,4 @@ async def test_airzone_climate_set_temp_error(hass: HomeAssistant) -> None:
)
state = hass.states.get("climate.salon")
assert state.attributes[ATTR_TEMPERATURE] == 24.0
assert state.attributes[ClimateEntityStateAttribute.TARGET_TEMPERATURE] == 24.0
+28 -21
View File
@@ -1,41 +1,48 @@
"""The select tests for the Airzone Cloud platform."""
from collections.abc import Generator
from unittest.mock import patch
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 ServiceValidationError
from homeassistant.helpers import entity_registry as er
from .util import async_init_integration
from tests.common import snapshot_platform
@pytest.fixture(autouse=True)
def override_platforms() -> Generator[None]:
"""Override PLATFORMS."""
with patch("homeassistant.components.airzone_cloud.PLATFORMS", [Platform.SELECT]):
yield
@pytest.mark.usefixtures("entity_registry_enabled_by_default")
async def test_airzone_create_selects(hass: HomeAssistant) -> None:
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)
# Zones
state = hass.states.get("select.dormitorio_air_quality_mode")
assert state.state == "auto"
await snapshot_platform(hass, entity_registry, snapshot, config_entry.entry_id)
state = hass.states.get("select.dormitorio_mode")
assert state is None
state = hass.states.get("select.salon_air_quality_mode")
assert state.state == "auto"
state = hass.states.get("select.salon_mode")
assert state.state == "cool"
assert state.attributes.get(ATTR_OPTIONS) == [
"cool",
"dry",
"fan",
"heat",
]
# Mode selects are only created for master zones
assert hass.states.get("select.dormitorio_mode") is None
async def test_airzone_select_air_quality_mode(hass: HomeAssistant) -> None:
+3 -1
View File
@@ -529,7 +529,7 @@ def mock_get_webserver(webserver: WebServer, devices: bool) -> dict[str, Any]:
async def async_init_integration(
hass: HomeAssistant,
) -> None:
) -> MockConfigEntry:
"""Set up the Airzone integration in Home Assistant."""
config_entry = MockConfigEntry(
@@ -568,3 +568,5 @@ async def async_init_integration(
):
await hass.config_entries.async_setup(config_entry.entry_id)
await hass.async_block_till_done()
return config_entry