Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add full test coverage for Comelit climate platform #140460

Merged
merged 12 commits into from
Mar 30, 2025
19 changes: 18 additions & 1 deletion tests/components/comelit/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,24 @@
FAKE_PIN = 0000

BRIDGE_DEVICE_QUERY = {
CLIMATE: {},
CLIMATE: {
0: ComelitSerialBridgeObject(
index=0,
name="Climate0",
status=0,
human_status="off",
type="climate",
val=[
[221, 0, "U", "M", 50, 0, 0, "U"],
[650, 0, "O", "M", 500, 0, 0, "N"],
[0, 0],
],
protected=0,
zone="Living room",
power=0.0,
power_unit=WATT,
),
},
COVER: {
0: ComelitSerialBridgeObject(
index=0,
Expand Down
71 changes: 71 additions & 0 deletions tests/components/comelit/snapshots/test_climate.ambr
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# serializer version: 1
# name: test_all_entities[climate.climate0-entry]
EntityRegistryEntrySnapshot({
'aliases': set({
}),
'area_id': None,
'capabilities': dict({
'hvac_modes': list([
<HVACMode.AUTO: 'auto'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.OFF: 'off'>,
]),
'max_temp': 30,
'min_temp': 5,
'target_temp_step': 0.1,
}),
'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.climate0',
'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': 'comelit',
'previous_unique_id': None,
'supported_features': <ClimateEntityFeature: 385>,
'translation_key': None,
'unique_id': 'serial_bridge_config_entry_id-0',
'unit_of_measurement': None,
})
# ---
# name: test_all_entities[climate.climate0-state]
StateSnapshot({
'attributes': ReadOnlyDict({
'current_temperature': 22.1,
'friendly_name': 'Climate0',
'hvac_action': <HVACAction.HEATING: 'heating'>,
'hvac_modes': list([
<HVACMode.AUTO: 'auto'>,
<HVACMode.COOL: 'cool'>,
<HVACMode.HEAT: 'heat'>,
<HVACMode.OFF: 'off'>,
]),
'max_temp': 30,
'min_temp': 5,
'supported_features': <ClimateEntityFeature: 385>,
'target_temp_step': 0.1,
'temperature': 5.0,
}),
'context': <ANY>,
'entity_id': 'climate.climate0',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'heat',
})
# ---
37 changes: 37 additions & 0 deletions tests/components/comelit/snapshots/test_diagnostics.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,43 @@
'devices': list([
dict({
'clima': list([
dict({
'0': dict({
'human_status': 'off',
'name': 'Climate0',
'power': 0.0,
'power_unit': 'W',
'protected': 0,
'status': 0,
'val': list([
list([
221,
0,
'U',
'M',
50,
0,
0,
'U',
]),
list([
650,
0,
'O',
'M',
500,
0,
0,
'N',
]),
list([
0,
0,
]),
]),
'zone': 'Living room',
}),
}),
]),
}),
dict({
Expand Down
Loading