Fix Atlantic Calissia target temperature in scheduled mode in Overkiz (#175405)

This commit is contained in:
Mick Vleeshouwer
2026-07-20 11:57:11 +02:00
committed by GitHub
parent 159feb0e0b
commit 557e655b71
6 changed files with 2023 additions and 3 deletions
@@ -167,7 +167,13 @@ class AtlanticElectricalHeaterWithAdjustableTemperatureSetpoint(
@override
def target_temperature(self) -> float | None:
"""Return the temperature."""
if state := self.device.states.get(OverkizState.CORE_TARGET_TEMPERATURE):
# core:TargetTemperatureState stays pinned to comfort in auto mode.
state_name = (
OverkizState.IO_EFFECTIVE_TEMPERATURE_SETPOINT
if self.hvac_mode == HVACMode.AUTO
else OverkizState.CORE_TARGET_TEMPERATURE
)
if state := self.device.states.get(state_name):
return state.value_as_float
return None
@@ -187,6 +193,10 @@ class AtlanticElectricalHeaterWithAdjustableTemperatureSetpoint(
async def async_set_temperature(self, **kwargs: Any) -> None:
"""Set new temperature."""
temperature = kwargs[ATTR_TEMPERATURE]
await self.executor.async_execute_command(
OverkizCommand.SET_TARGET_TEMPERATURE, temperature
# setTargetTemperature would overwrite comfort instead of the preset.
command = (
OverkizCommand.SET_DEROGATED_TARGET_TEMPERATURE
if self.hvac_mode == HVACMode.AUTO
else OverkizCommand.SET_TARGET_TEMPERATURE
)
await self.executor.async_execute_command(command, temperature)
File diff suppressed because it is too large Load Diff
@@ -174,6 +174,100 @@
'state': 'heat',
})
# ---
# name: test_climate_entities_snapshot[cloud_atlantic_cozytouch.json][climate.my_home_living_room_heater-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.HEAT: 'heat'>,
<HVACMode.OFF: 'off'>,
<HVACMode.AUTO: 'auto'>,
]),
<ClimateEntityCapabilityAttribute.MAX_TEMP: 'max_temp'>: 35,
<ClimateEntityCapabilityAttribute.MIN_TEMP: 'min_temp'>: 7,
<ClimateEntityCapabilityAttribute.PRESET_MODES: 'preset_modes'>: list([
'none',
'frost_protection',
'eco',
'comfort',
'comfort-1',
'comfort-2',
'auto',
'boost',
'external',
'prog',
]),
}),
'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.my_home_living_room_heater',
'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': 'overkiz',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': <ClimateEntityFeature: 401>,
'translation_key': 'overkiz',
'unique_id': 'io://1234-5678-5643/11009627#1',
'unit_of_measurement': None,
})
# ---
# name: test_climate_entities_snapshot[cloud_atlantic_cozytouch.json][climate.my_home_living_room_heater-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<ClimateEntityStateAttribute.CURRENT_TEMPERATURE: 'current_temperature'>: 20.5,
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Living Room Heater',
<ClimateEntityStateAttribute.HVAC_ACTION: 'hvac_action'>: <HVACAction.OFF: 'off'>,
<ClimateEntityCapabilityAttribute.HVAC_MODES: 'hvac_modes'>: list([
<HVACMode.HEAT: 'heat'>,
<HVACMode.OFF: 'off'>,
<HVACMode.AUTO: 'auto'>,
]),
<ClimateEntityCapabilityAttribute.MAX_TEMP: 'max_temp'>: 35,
<ClimateEntityCapabilityAttribute.MIN_TEMP: 'min_temp'>: 7,
<ClimateEntityStateAttribute.PRESET_MODE: 'preset_mode'>: 'eco',
<ClimateEntityCapabilityAttribute.PRESET_MODES: 'preset_modes'>: list([
'none',
'frost_protection',
'eco',
'comfort',
'comfort-1',
'comfort-2',
'auto',
'boost',
'external',
'prog',
]),
<EntityStateAttribute.SUPPORTED_FEATURES: 'supported_features'>: <ClimateEntityFeature: 401>,
<ClimateEntityStateAttribute.TEMPERATURE: 'temperature'>: 16.5,
}),
'context': <ANY>,
'entity_id': 'climate.my_home_living_room_heater',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'auto',
})
# ---
# name: test_climate_entities_snapshot[cloud_hi_kumo_europe.json][climate.somfy_tahoma_switch_yutaki_zone_1-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
@@ -247,6 +247,130 @@
'state': '3',
})
# ---
# name: test_number_entities_snapshot[cloud_atlantic_cozytouch.json][number.my_home_living_room_heater_comfort_room_temperature-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
<NumberEntityCapabilityAttribute.MAX: 'max'>: 30,
<NumberEntityCapabilityAttribute.MIN: 'min'>: 7,
<NumberEntityCapabilityAttribute.MODE: 'mode'>: <NumberMode.AUTO: 'auto'>,
<NumberEntityCapabilityAttribute.STEP: 'step'>: 1.0,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.my_home_living_room_heater_comfort_room_temperature',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Comfort room temperature',
'options': dict({
}),
'original_device_class': <NumberDeviceClass.TEMPERATURE: 'temperature'>,
'original_icon': 'mdi:home-thermometer-outline',
'original_name': 'Comfort room temperature',
'platform': 'overkiz',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': 'io://1234-5678-5643/11009627#1-core:ComfortRoomTemperatureState',
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
})
# ---
# name: test_number_entities_snapshot[cloud_atlantic_cozytouch.json][number.my_home_living_room_heater_comfort_room_temperature-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<EntityStateAttribute.DEVICE_CLASS: 'device_class'>: 'temperature',
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Living Room Heater Comfort room temperature',
<EntityStateAttribute.ICON: 'icon'>: 'mdi:home-thermometer-outline',
<NumberEntityCapabilityAttribute.MAX: 'max'>: 30,
<NumberEntityCapabilityAttribute.MIN: 'min'>: 7,
<NumberEntityCapabilityAttribute.MODE: 'mode'>: <NumberMode.AUTO: 'auto'>,
<NumberEntityCapabilityAttribute.STEP: 'step'>: 1.0,
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: <UnitOfTemperature.CELSIUS: '°C'>,
}),
'context': <ANY>,
'entity_id': 'number.my_home_living_room_heater_comfort_room_temperature',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '20',
})
# ---
# name: test_number_entities_snapshot[cloud_atlantic_cozytouch.json][number.my_home_living_room_heater_eco_room_temperature-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
<NumberEntityCapabilityAttribute.MAX: 'max'>: 29,
<NumberEntityCapabilityAttribute.MIN: 'min'>: 6,
<NumberEntityCapabilityAttribute.MODE: 'mode'>: <NumberMode.AUTO: 'auto'>,
<NumberEntityCapabilityAttribute.STEP: 'step'>: 1.0,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'number',
'entity_category': <EntityCategory.CONFIG: 'config'>,
'entity_id': 'number.my_home_living_room_heater_eco_room_temperature',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Eco room temperature',
'options': dict({
}),
'original_device_class': <NumberDeviceClass.TEMPERATURE: 'temperature'>,
'original_icon': 'mdi:thermometer',
'original_name': 'Eco room temperature',
'platform': 'overkiz',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': 'io://1234-5678-5643/11009627#1-core:EcoRoomTemperatureState',
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
})
# ---
# name: test_number_entities_snapshot[cloud_atlantic_cozytouch.json][number.my_home_living_room_heater_eco_room_temperature-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<EntityStateAttribute.DEVICE_CLASS: 'device_class'>: 'temperature',
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Living Room Heater Eco room temperature',
<EntityStateAttribute.ICON: 'icon'>: 'mdi:thermometer',
<NumberEntityCapabilityAttribute.MAX: 'max'>: 29,
<NumberEntityCapabilityAttribute.MIN: 'min'>: 6,
<NumberEntityCapabilityAttribute.MODE: 'mode'>: <NumberMode.AUTO: 'auto'>,
<NumberEntityCapabilityAttribute.STEP: 'step'>: 1.0,
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: <UnitOfTemperature.CELSIUS: '°C'>,
}),
'context': <ANY>,
'entity_id': 'number.my_home_living_room_heater_eco_room_temperature',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '3.5',
})
# ---
# name: test_number_entities_snapshot[cloud_atlantic_cozytouch.json][number.my_home_patio_water_heating_away_mode_duration-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
@@ -280,6 +280,287 @@
'state': '74',
})
# ---
# name: test_sensor_entities_snapshot[cloud_atlantic_cozytouch.json][sensor.my_home_living_room_heater_discrete_rssi_level-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
<SensorEntityCapabilityAttribute.OPTIONS: 'options'>: list([
'verylow',
'low',
'normal',
'good',
]),
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'sensor.my_home_living_room_heater_discrete_rssi_level',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Discrete RSSI level',
'options': dict({
}),
'original_device_class': <SensorDeviceClass.ENUM: 'enum'>,
'original_icon': 'mdi:wifi',
'original_name': 'Discrete RSSI level',
'platform': 'overkiz',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'discrete_rssi_level',
'unique_id': 'io://1234-5678-5643/11009627#1-core:DiscreteRSSILevelState',
'unit_of_measurement': None,
})
# ---
# name: test_sensor_entities_snapshot[cloud_atlantic_cozytouch.json][sensor.my_home_living_room_heater_discrete_rssi_level-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<EntityStateAttribute.DEVICE_CLASS: 'device_class'>: 'enum',
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Living Room Heater Discrete RSSI level',
<EntityStateAttribute.ICON: 'icon'>: 'mdi:wifi',
<SensorEntityCapabilityAttribute.OPTIONS: 'options'>: list([
'verylow',
'low',
'normal',
'good',
]),
}),
'context': <ANY>,
'entity_id': 'sensor.my_home_living_room_heater_discrete_rssi_level',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'good',
})
# ---
# name: test_sensor_entities_snapshot[cloud_atlantic_cozytouch.json][sensor.my_home_living_room_heater_living_room_heater_temperature_temperature-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
<SensorEntityCapabilityAttribute.STATE_CLASS: 'state_class'>: <SensorStateClass.MEASUREMENT: 'measurement'>,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.my_home_living_room_heater_living_room_heater_temperature_temperature',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Living Room Heater Temperature Temperature',
'options': dict({
'sensor': dict({
'suggested_display_precision': 1,
}),
}),
'original_device_class': <SensorDeviceClass.TEMPERATURE: 'temperature'>,
'original_icon': None,
'original_name': 'Living Room Heater Temperature Temperature',
'platform': 'overkiz',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': 'io://1234-5678-5643/11009627#2-core:TemperatureState',
'unit_of_measurement': <UnitOfTemperature.CELSIUS: '°C'>,
})
# ---
# name: test_sensor_entities_snapshot[cloud_atlantic_cozytouch.json][sensor.my_home_living_room_heater_living_room_heater_temperature_temperature-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<EntityStateAttribute.DEVICE_CLASS: 'device_class'>: 'temperature',
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Living Room Heater Living Room Heater Temperature Temperature',
<SensorEntityCapabilityAttribute.STATE_CLASS: 'state_class'>: <SensorStateClass.MEASUREMENT: 'measurement'>,
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: <UnitOfTemperature.CELSIUS: '°C'>,
}),
'context': <ANY>,
'entity_id': 'sensor.my_home_living_room_heater_living_room_heater_temperature_temperature',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '20.5',
})
# ---
# name: test_sensor_entities_snapshot[cloud_atlantic_cozytouch.json][sensor.my_home_living_room_heater_priority_lock_originator-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.my_home_living_room_heater_priority_lock_originator',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Priority lock originator',
'options': dict({
}),
'original_device_class': None,
'original_icon': 'mdi:lock',
'original_name': 'Priority lock originator',
'platform': 'overkiz',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': 'priority_lock_originator',
'unique_id': 'io://1234-5678-5643/11009627#1-io:PriorityLockOriginatorState',
'unit_of_measurement': None,
})
# ---
# name: test_sensor_entities_snapshot[cloud_atlantic_cozytouch.json][sensor.my_home_living_room_heater_priority_lock_originator-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Living Room Heater Priority lock originator',
<EntityStateAttribute.ICON: 'icon'>: 'mdi:lock',
}),
'context': <ANY>,
'entity_id': 'sensor.my_home_living_room_heater_priority_lock_originator',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_sensor_entities_snapshot[cloud_atlantic_cozytouch.json][sensor.my_home_living_room_heater_priority_lock_timer-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': None,
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': None,
'entity_id': 'sensor.my_home_living_room_heater_priority_lock_timer',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'Priority lock timer',
'options': dict({
}),
'original_device_class': None,
'original_icon': 'mdi:lock-clock',
'original_name': 'Priority lock timer',
'platform': 'overkiz',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': 'io://1234-5678-5643/11009627#1-core:PriorityLockTimerState',
'unit_of_measurement': <UnitOfTime.SECONDS: 's'>,
})
# ---
# name: test_sensor_entities_snapshot[cloud_atlantic_cozytouch.json][sensor.my_home_living_room_heater_priority_lock_timer-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Living Room Heater Priority lock timer',
<EntityStateAttribute.ICON: 'icon'>: 'mdi:lock-clock',
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: <UnitOfTime.SECONDS: 's'>,
}),
'context': <ANY>,
'entity_id': 'sensor.my_home_living_room_heater_priority_lock_timer',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': 'unknown',
})
# ---
# name: test_sensor_entities_snapshot[cloud_atlantic_cozytouch.json][sensor.my_home_living_room_heater_rssi_level-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
None,
]),
'area_id': None,
'capabilities': dict({
<SensorEntityCapabilityAttribute.STATE_CLASS: 'state_class'>: <SensorStateClass.MEASUREMENT: 'measurement'>,
}),
'config_entry_id': <ANY>,
'config_subentry_id': <ANY>,
'device_class': None,
'device_id': <ANY>,
'disabled_by': None,
'domain': 'sensor',
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
'entity_id': 'sensor.my_home_living_room_heater_rssi_level',
'has_entity_name': True,
'hidden_by': None,
'icon': None,
'id': <ANY>,
'labels': set({
}),
'name': None,
'object_id_base': 'RSSI level',
'options': dict({
}),
'original_device_class': <SensorDeviceClass.SIGNAL_STRENGTH: 'signal_strength'>,
'original_icon': None,
'original_name': 'RSSI level',
'platform': 'overkiz',
'previous_unique_id': None,
'suggested_object_id': None,
'supported_features': 0,
'translation_key': None,
'unique_id': 'io://1234-5678-5643/11009627#1-core:RSSILevelState',
'unit_of_measurement': 'dB',
})
# ---
# name: test_sensor_entities_snapshot[cloud_atlantic_cozytouch.json][sensor.my_home_living_room_heater_rssi_level-state]
StateSnapshot({
'attributes': ReadOnlyDict({
<EntityStateAttribute.DEVICE_CLASS: 'device_class'>: 'signal_strength',
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Living Room Heater RSSI level',
<SensorEntityCapabilityAttribute.STATE_CLASS: 'state_class'>: <SensorStateClass.MEASUREMENT: 'measurement'>,
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: 'dB',
}),
'context': <ANY>,
'entity_id': 'sensor.my_home_living_room_heater_rssi_level',
'last_changed': <ANY>,
'last_reported': <ANY>,
'last_updated': <ANY>,
'state': '94',
})
# ---
# name: test_sensor_entities_snapshot[cloud_atlantic_cozytouch.json][sensor.my_home_patio_water_heating_bottom_tank_water_temperature-entry]
EntityRegistryEntrySnapshot({
'aliases': list([
+145
View File
@@ -45,6 +45,12 @@ COZYTOUCH = FixtureDevice(
"modbuslink://1234-5678-5643/1#1",
"climate.living_room_heater",
)
# Atlantic Calissia (io:AtlanticElectricalHeaterWithAdjustableTemperatureSetpointIOComponent)
ELECTRICAL_HEATER_ADJUSTABLE = FixtureDevice(
"setup/cloud_atlantic_cozytouch.json",
"io://1234-5678-5643/11009627#1",
"climate.my_home_living_room_heater",
)
# Hitachi Yutaki 2-zone air-to-water heat pump
YUTAKI_ZONE_1 = FixtureDevice(
@@ -171,6 +177,145 @@ async def test_events_for_unknown_device_url(
assert state is not None
async def test_electrical_heater_adjustable_target_temperature(
hass: HomeAssistant,
freezer: FrozenDateTimeFactory,
mock_client: MockOverkizClient,
setup_overkiz_integration: SetupOverkizIntegration,
) -> None:
"""Test target_temperature tracks the effective setpoint only in auto mode."""
await setup_overkiz_integration(fixture=ELECTRICAL_HEATER_ADJUSTABLE.fixture)
# Fixture starts in auto (external) mode with the eco preset active.
state = hass.states.get(ELECTRICAL_HEATER_ADJUSTABLE.entity_id)
assert state is not None
assert state.attributes[ATTR_TEMPERATURE] == 16.5
# The preset changes to comfort while still scheduled (auto).
await async_deliver_events(
hass,
freezer,
mock_client,
[
device_state_changed_event(
device_url=ELECTRICAL_HEATER_ADJUSTABLE.device_url,
device_states=[
{
"name": OverkizState.IO_TARGET_HEATING_LEVEL,
"type": 3,
"value": "comfort",
},
{
"name": OverkizState.IO_EFFECTIVE_TEMPERATURE_SETPOINT,
"type": 2,
"value": 20.0,
},
],
)
],
)
state = hass.states.get(ELECTRICAL_HEATER_ADJUSTABLE.entity_id)
assert state is not None
assert state.attributes[ATTR_TEMPERATURE] == 20.0
# While scheduled (auto), setting a temperature derogates the active
# preset instead of overwriting the comfort setpoint.
await hass.services.async_call(
"climate",
"set_temperature",
{"entity_id": ELECTRICAL_HEATER_ADJUSTABLE.entity_id, ATTR_TEMPERATURE: 19.0},
blocking=True,
)
assert_command_call(
mock_client,
device_url=ELECTRICAL_HEATER_ADJUSTABLE.device_url,
command_name="setDerogatedTargetTemperature",
parameters=[19.0],
)
# The device reports the derogation by updating the effective setpoint.
await async_deliver_events(
hass,
freezer,
mock_client,
[
device_state_changed_event(
device_url=ELECTRICAL_HEATER_ADJUSTABLE.device_url,
device_states=[
{
"name": OverkizState.IO_EFFECTIVE_TEMPERATURE_SETPOINT,
"type": 2,
"value": 19.0,
},
],
)
],
)
state = hass.states.get(ELECTRICAL_HEATER_ADJUSTABLE.entity_id)
assert state is not None
assert state.attributes[ATTR_TEMPERATURE] == 19.0
mock_client.execute_action_group.reset_mock()
# Leaving auto (scheduled) mode for manual falls back to
# core:TargetTemperatureState, and setting a temperature now targets
# that state directly instead of derogating.
await async_deliver_events(
hass,
freezer,
mock_client,
[
device_state_changed_event(
device_url=ELECTRICAL_HEATER_ADJUSTABLE.device_url,
device_states=[
{
"name": OverkizState.CORE_OPERATING_MODE,
"type": 3,
"value": "manual",
},
],
)
],
)
state = hass.states.get(ELECTRICAL_HEATER_ADJUSTABLE.entity_id)
assert state is not None
assert state.attributes[ATTR_TEMPERATURE] == 20.0
await hass.services.async_call(
"climate",
"set_temperature",
{"entity_id": ELECTRICAL_HEATER_ADJUSTABLE.entity_id, ATTR_TEMPERATURE: 21.0},
blocking=True,
)
assert_command_call(
mock_client,
device_url=ELECTRICAL_HEATER_ADJUSTABLE.device_url,
command_name="setTargetTemperature",
parameters=[21.0],
)
await async_deliver_events(
hass,
freezer,
mock_client,
[
device_state_changed_event(
device_url=ELECTRICAL_HEATER_ADJUSTABLE.device_url,
device_states=[
{
"name": OverkizState.CORE_TARGET_TEMPERATURE,
"type": 2,
"value": 21.0,
},
],
)
],
)
state = hass.states.get(ELECTRICAL_HEATER_ADJUSTABLE.entity_id)
assert state is not None
assert state.attributes[ATTR_TEMPERATURE] == 21.0
async def test_hitachi_air_to_water_heating_zone_2(
hass: HomeAssistant,
setup_overkiz_integration: SetupOverkizIntegration,