diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d777774d..9d8e648d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ Versions from 0.40 and up +## Ongoing + +- Add a ThermoZone to Anna + ## v0.59.0 - New Feature: use RestoreState in climate to save schedule en regulation status, also via plugwise [v1.8.3](https://github.com/plugwise/python-plugwise/releases/tag/v1.8.3) @@ -15,7 +19,6 @@ Versions from 0.40 and up - Fix mypy errors in Core (not accepted in HA Core) - Introduce Snapshot testing for all platforms (requirement from HA Core) -- New Feature: add initial support for the Emma via plugwise [v1.8.0](https://github.com/plugwise/python-plugwise/releases/tag/v1.8.0) ## v0.57.6 diff --git a/custom_components/plugwise/climate.py b/custom_components/plugwise/climate.py index b8246530c..00f934e8f 100644 --- a/custom_components/plugwise/climate.py +++ b/custom_components/plugwise/climate.py @@ -36,10 +36,8 @@ CONTROL_STATE, DEV_CLASS, DOMAIN, - LOCATION, LOGGER, LOWER_BOUND, - MASTER_THERMOSTATS, REGULATION_MODES, RESOLUTION, SELECT_REGULATION_MODE, @@ -76,18 +74,9 @@ def _add_entities() -> None: return entities: list[PlugwiseClimateEntity] = [] - gateway_name = coordinator.api.smile.name for device_id in coordinator.new_devices: device = coordinator.data[device_id] - if gateway_name == "Adam": - if device[DEV_CLASS] == "climate": - entities.append( - PlugwiseClimateEntity( - coordinator, device_id, homekit_enabled - ) # pw-beta homekit emulation - ) - LOGGER.debug("Add climate %s", device[ATTR_NAME]) - elif device[DEV_CLASS] in MASTER_THERMOSTATS: + if device[DEV_CLASS] == "climate": entities.append( PlugwiseClimateEntity( coordinator, device_id, homekit_enabled @@ -160,10 +149,7 @@ def __init__( gateway_id: str = coordinator.api.gateway_id self._gateway_data = coordinator.data[gateway_id] self._homekit_enabled = homekit_enabled # pw-beta homekit emulation - self._location = device_id - if (location := self.device.get(LOCATION)) is not None: - self._location = location - + self._location_id = device_id self._attr_max_temp = min(self.device.get(THERMOSTAT, {}).get(UPPER_BOUND, 35.0), 35.0) self._attr_min_temp = self.device.get(THERMOSTAT, {}).get(LOWER_BOUND, 0.0) # Ensure we don't drop below 0.1 @@ -311,7 +297,7 @@ async def async_set_temperature(self, **kwargs: Any) -> None: if mode := kwargs.get(ATTR_HVAC_MODE): await self.async_set_hvac_mode(mode) - await self.coordinator.api.set_temperature(self._location, data) + await self.coordinator.api.set_temperature(self._location_id, data) @plugwise_command async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None: @@ -334,7 +320,7 @@ async def async_set_hvac_mode(self, hvac_mode: HVACMode) -> None: raise HomeAssistantError(ERROR_NO_SCHEDULE) await self.coordinator.api.set_schedule_state( - self._location, + self._location_id, STATE_ON if hvac_mode == HVACMode.AUTO else STATE_OFF, desired, ) @@ -363,4 +349,4 @@ async def _homekit_translate_or_not(self, mode: HVACMode) -> None: @plugwise_command async def async_set_preset_mode(self, preset_mode: str) -> None: """Set the preset mode.""" - await self.coordinator.api.set_preset(self._location, preset_mode) + await self.coordinator.api.set_preset(self._location_id, preset_mode) diff --git a/tests/components/plugwise/fixtures/anna_heatpump_heating/data.json b/tests/components/plugwise/fixtures/anna_heatpump_heating/data.json index ab6bdf08e..b729e63be 100644 --- a/tests/components/plugwise/fixtures/anna_heatpump_heating/data.json +++ b/tests/components/plugwise/fixtures/anna_heatpump_heating/data.json @@ -59,24 +59,17 @@ "vendor": "Techneco" }, "3cb70739631c4d17a86b8b12e8a5161b": { - "active_preset": "home", - "available_schedules": ["standaard", "off"], - "climate_mode": "auto", - "control_state": "heating", "dev_class": "thermostat", "firmware": "2018-02-08T11:15:53+01:00", "hardware": "6539-1301-5002", "location": "c784ee9fdab44e1395b8dee7d7a497d5", "model": "ThermoTouch", "name": "Anna", - "preset_modes": ["no_frost", "home", "away", "asleep", "vacation"], - "select_schedule": "standaard", "sensors": { "cooling_activation_outdoor_temperature": 21.0, "cooling_deactivation_threshold": 4.0, "illuminance": 86.0, - "setpoint_high": 30.0, - "setpoint_low": 20.5, + "setpoint": 20.5, "temperature": 19.3 }, "temperature_offset": { @@ -85,6 +78,23 @@ "setpoint": -0.5, "upper_bound": 2.0 }, + "vendor": "Plugwise" + }, + "c784ee9fdab44e1395b8dee7d7a497d5": { + "active_preset": "home", + "available_schedules": ["standaard", "off"], + "climate_mode": "auto", + "control_state": "idle", + "dev_class": "climate", + "model": "ThermoZone", + "name": "Living room", + "preset_modes": ["no_frost", "home", "away", "asleep", "vacation"], + "select_schedule": "standaard", + "sensors": { + "setpoint_high": 30.0, + "setpoint_low": 20.5, + "temperature": 23.3 + }, "thermostat": { "lower_bound": 4.0, "resolution": 0.1, @@ -92,6 +102,10 @@ "setpoint_low": 20.5, "upper_bound": 30.0 }, + "thermostats": { + "primary": ["3cb70739631c4d17a86b8b12e8a5161b"], + "secondary": [] + }, "vendor": "Plugwise" } } diff --git a/tests/components/plugwise/fixtures/anna_v4/data.json b/tests/components/plugwise/fixtures/anna_v4/data.json index 7e6f138be..5efedb918 100644 --- a/tests/components/plugwise/fixtures/anna_v4/data.json +++ b/tests/components/plugwise/fixtures/anna_v4/data.json @@ -1,17 +1,11 @@ { "01b85360fdd243d0aaad4d6ac2a5ba7e": { - "active_preset": "home", - "available_schedules": ["Standaard", "Thuiswerken", "off"], - "climate_mode": "heat", - "control_state": "heating", "dev_class": "thermostat", "firmware": "2018-02-08T11:15:53+01:00", "hardware": "6539-1301-5002", "location": "eb5309212bf5407bb143e5bfa3b18aee", "model": "ThermoTouch", "name": "Anna", - "preset_modes": ["vacation", "no_frost", "away", "asleep", "home"], - "select_schedule": "off", "sensors": { "illuminance": 60.0, "setpoint": 20.5, @@ -23,12 +17,6 @@ "setpoint": 0.0, "upper_bound": 2.0 }, - "thermostat": { - "lower_bound": 4.0, - "resolution": 0.1, - "setpoint": 20.5, - "upper_bound": 30.0 - }, "vendor": "Plugwise" }, "0466eae8520144c78afb29628384edeb": { @@ -84,5 +72,30 @@ "dhw_cm_switch": false }, "vendor": "Bosch Thermotechniek B.V." + }, + "eb5309212bf5407bb143e5bfa3b18aee": { + "active_preset": "home", + "available_schedules": ["Standaard", "Thuiswerken", "off"], + "climate_mode": "heat", + "control_state": "idle", + "dev_class": "climate", + "model": "ThermoZone", + "name": "Living room", + "preset_modes": ["vacation", "no_frost", "away", "asleep", "home"], + "select_schedule": "off", + "sensors": { + "temperature": 20.6 + }, + "thermostat": { + "lower_bound": 4.0, + "resolution": 0.1, + "setpoint": 20.5, + "upper_bound": 30.0 + }, + "thermostats": { + "primary": ["01b85360fdd243d0aaad4d6ac2a5ba7e"], + "secondary": [] + }, + "vendor": "Plugwise" } } diff --git a/tests/components/plugwise/fixtures/m_anna_heatpump_cooling/data.json b/tests/components/plugwise/fixtures/m_anna_heatpump_cooling/data.json index ccfd816ff..9e827540e 100644 --- a/tests/components/plugwise/fixtures/m_anna_heatpump_cooling/data.json +++ b/tests/components/plugwise/fixtures/m_anna_heatpump_cooling/data.json @@ -59,25 +59,18 @@ "vendor": "Techneco" }, "3cb70739631c4d17a86b8b12e8a5161b": { - "active_preset": "home", - "available_schedules": ["standaard", "off"], - "climate_mode": "auto", - "control_state": "cooling", "dev_class": "thermostat", "firmware": "2018-02-08T11:15:53+01:00", "hardware": "6539-1301-5002", "location": "c784ee9fdab44e1395b8dee7d7a497d5", "model": "ThermoTouch", "name": "Anna", - "preset_modes": ["no_frost", "home", "away", "asleep", "vacation"], - "select_schedule": "standaard", "sensors": { "cooling_activation_outdoor_temperature": 21.0, "cooling_deactivation_threshold": 4.0, "illuminance": 86.0, - "setpoint_high": 30.0, - "setpoint_low": 20.5, - "temperature": 26.3 + "setpoint": 20.5, + "temperature": 19.3 }, "temperature_offset": { "lower_bound": -2.0, @@ -85,6 +78,23 @@ "setpoint": -0.5, "upper_bound": 2.0 }, + "vendor": "Plugwise" + }, + "c784ee9fdab44e1395b8dee7d7a497d5": { + "active_preset": "home", + "available_schedules": ["standaard", "off"], + "climate_mode": "auto", + "control_state": "cooling", + "dev_class": "climate", + "model": "ThermoZone", + "name": "Living room", + "preset_modes": ["no_frost", "home", "away", "asleep", "vacation"], + "select_schedule": "standaard", + "sensors": { + "setpoint_high": 30.0, + "setpoint_low": 20.5, + "temperature": 26.3 + }, "thermostat": { "lower_bound": 4.0, "resolution": 0.1, @@ -92,6 +102,10 @@ "setpoint_low": 20.5, "upper_bound": 30.0 }, + "thermostats": { + "primary": ["3cb70739631c4d17a86b8b12e8a5161b"], + "secondary": [] + }, "vendor": "Plugwise" } } diff --git a/tests/components/plugwise/fixtures/m_anna_heatpump_idle/data.json b/tests/components/plugwise/fixtures/m_anna_heatpump_idle/data.json index 5a1cdebd3..8fc72b612 100644 --- a/tests/components/plugwise/fixtures/m_anna_heatpump_idle/data.json +++ b/tests/components/plugwise/fixtures/m_anna_heatpump_idle/data.json @@ -59,25 +59,18 @@ "vendor": "Techneco" }, "3cb70739631c4d17a86b8b12e8a5161b": { - "active_preset": "home", - "available_schedules": ["standaard", "off"], - "climate_mode": "auto", - "control_state": "idle", "dev_class": "thermostat", "firmware": "2018-02-08T11:15:53+01:00", "hardware": "6539-1301-5002", "location": "c784ee9fdab44e1395b8dee7d7a497d5", "model": "ThermoTouch", "name": "Anna", - "preset_modes": ["no_frost", "home", "away", "asleep", "vacation"], - "select_schedule": "standaard", "sensors": { - "cooling_activation_outdoor_temperature": 25.0, + "cooling_activation_outdoor_temperature": 21.0, "cooling_deactivation_threshold": 4.0, "illuminance": 86.0, - "setpoint_high": 30.0, - "setpoint_low": 20.5, - "temperature": 23.0 + "setpoint": 20.5, + "temperature": 19.3 }, "temperature_offset": { "lower_bound": -2.0, @@ -85,6 +78,24 @@ "setpoint": -0.5, "upper_bound": 2.0 }, + "vendor": "Plugwise" + }, + "c784ee9fdab44e1395b8dee7d7a497d5": { + "active_preset": "home", + "available_schedules": ["standaard", "off"], + "climate_mode": "auto", + "control_state": "idle", + "dev_class": "climate", + "model": "ThermoZone", + "name": "Living room", + "preset_modes": ["no_frost", "home", "away", "asleep", "vacation"], + "select_schedule": "standaard", + "sensors": { + "cooling_activation_outdoor_temperature": 25.0, + "setpoint_high": 30.0, + "setpoint_low": 20.5, + "temperature": 23.0 + }, "thermostat": { "lower_bound": 4.0, "resolution": 0.1, @@ -92,6 +103,10 @@ "setpoint_low": 20.5, "upper_bound": 30.0 }, + "thermostats": { + "primary": ["3cb70739631c4d17a86b8b12e8a5161b"], + "secondary": [] + }, "vendor": "Plugwise" } } diff --git a/tests/components/plugwise/snapshots/test_climate.ambr b/tests/components/plugwise/snapshots/test_climate.ambr index 63dc6a419..c27bd10c5 100644 --- a/tests/components/plugwise/snapshots/test_climate.ambr +++ b/tests/components/plugwise/snapshots/test_climate.ambr @@ -575,7 +575,7 @@ 'state': 'auto', }) # --- -# name: test_anna_2_climate_snapshot[platforms0-True-m_anna_heatpump_cooling][climate.anna-entry] +# name: test_anna_2_climate_snapshot[platforms0-True-m_anna_heatpump_cooling][climate.living_room-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -603,7 +603,7 @@ 'disabled_by': None, 'domain': 'climate', 'entity_category': None, - 'entity_id': 'climate.anna', + 'entity_id': 'climate.living_room', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -621,15 +621,15 @@ 'suggested_object_id': None, 'supported_features': , 'translation_key': 'plugwise', - 'unique_id': '3cb70739631c4d17a86b8b12e8a5161b-climate', + 'unique_id': 'c784ee9fdab44e1395b8dee7d7a497d5-climate', 'unit_of_measurement': None, }) # --- -# name: test_anna_2_climate_snapshot[platforms0-True-m_anna_heatpump_cooling][climate.anna-state] +# name: test_anna_2_climate_snapshot[platforms0-True-m_anna_heatpump_cooling][climate.living_room-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'current_temperature': 26.3, - 'friendly_name': 'Anna', + 'friendly_name': 'Living room', 'hvac_action': , 'hvac_modes': list([ , @@ -651,14 +651,14 @@ 'target_temp_step': 0.1, }), 'context': , - 'entity_id': 'climate.anna', + 'entity_id': 'climate.living_room', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'auto', }) # --- -# name: test_anna_3_climate_snapshot[platforms0-True-m_anna_heatpump_idle][climate.anna-entry] +# name: test_anna_3_climate_snapshot[platforms0-True-m_anna_heatpump_idle][climate.living_room-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -686,7 +686,7 @@ 'disabled_by': None, 'domain': 'climate', 'entity_category': None, - 'entity_id': 'climate.anna', + 'entity_id': 'climate.living_room', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -704,15 +704,15 @@ 'suggested_object_id': None, 'supported_features': , 'translation_key': 'plugwise', - 'unique_id': '3cb70739631c4d17a86b8b12e8a5161b-climate', + 'unique_id': 'c784ee9fdab44e1395b8dee7d7a497d5-climate', 'unit_of_measurement': None, }) # --- -# name: test_anna_3_climate_snapshot[platforms0-True-m_anna_heatpump_idle][climate.anna-state] +# name: test_anna_3_climate_snapshot[platforms0-True-m_anna_heatpump_idle][climate.living_room-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'current_temperature': 23.0, - 'friendly_name': 'Anna', + 'friendly_name': 'Living room', 'hvac_action': , 'hvac_modes': list([ , @@ -734,14 +734,14 @@ 'target_temp_step': 0.1, }), 'context': , - 'entity_id': 'climate.anna', + 'entity_id': 'climate.living_room', 'last_changed': , 'last_reported': , 'last_updated': , 'state': 'auto', }) # --- -# name: test_anna_climate_snapshot[platforms0-True-anna_heatpump_heating][climate.anna-entry] +# name: test_anna_climate_snapshot[platforms0-True-anna_heatpump_heating][climate.living_room-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -769,7 +769,7 @@ 'disabled_by': None, 'domain': 'climate', 'entity_category': None, - 'entity_id': 'climate.anna', + 'entity_id': 'climate.living_room', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -787,16 +787,16 @@ 'suggested_object_id': None, 'supported_features': , 'translation_key': 'plugwise', - 'unique_id': '3cb70739631c4d17a86b8b12e8a5161b-climate', + 'unique_id': 'c784ee9fdab44e1395b8dee7d7a497d5-climate', 'unit_of_measurement': None, }) # --- -# name: test_anna_climate_snapshot[platforms0-True-anna_heatpump_heating][climate.anna-state] +# name: test_anna_climate_snapshot[platforms0-True-anna_heatpump_heating][climate.living_room-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'current_temperature': 19.3, - 'friendly_name': 'Anna', - 'hvac_action': , + 'current_temperature': 23.3, + 'friendly_name': 'Living room', + 'hvac_action': , 'hvac_modes': list([ , , @@ -817,7 +817,7 @@ 'target_temp_step': 0.1, }), 'context': , - 'entity_id': 'climate.anna', + 'entity_id': 'climate.living_room', 'last_changed': , 'last_reported': , 'last_updated': , diff --git a/tests/components/plugwise/snapshots/test_sensor.ambr b/tests/components/plugwise/snapshots/test_sensor.ambr index 5489c1477..996e060d2 100644 --- a/tests/components/plugwise/snapshots/test_sensor.ambr +++ b/tests/components/plugwise/snapshots/test_sensor.ambr @@ -4263,7 +4263,60 @@ 'state': '17.2', }) # --- -# name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.anna_cooling_setpoint-entry] +# name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.anna_illuminance-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.anna_illuminance', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Illuminance', + 'platform': 'plugwise', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': None, + 'unique_id': '3cb70739631c4d17a86b8b12e8a5161b-illuminance', + 'unit_of_measurement': 'lx', + }) +# --- +# name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.anna_illuminance-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'illuminance', + 'friendly_name': 'Anna Illuminance', + 'state_class': , + 'unit_of_measurement': 'lx', + }), + 'context': , + 'entity_id': 'sensor.anna_illuminance', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '86.0', + }) +# --- +# name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.anna_setpoint-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -4278,7 +4331,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': , - 'entity_id': 'sensor.anna_cooling_setpoint', + 'entity_id': 'sensor.anna_setpoint', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -4293,33 +4346,33 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Cooling setpoint', + 'original_name': 'Setpoint', 'platform': 'plugwise', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': 'cooling_setpoint', - 'unique_id': '3cb70739631c4d17a86b8b12e8a5161b-setpoint_high', + 'translation_key': 'setpoint', + 'unique_id': '3cb70739631c4d17a86b8b12e8a5161b-setpoint', 'unit_of_measurement': , }) # --- -# name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.anna_cooling_setpoint-state] +# name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.anna_setpoint-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'temperature', - 'friendly_name': 'Anna Cooling setpoint', + 'friendly_name': 'Anna Setpoint', 'state_class': , 'unit_of_measurement': , }), 'context': , - 'entity_id': 'sensor.anna_cooling_setpoint', + 'entity_id': 'sensor.anna_setpoint', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': '30.0', + 'state': '20.5', }) # --- -# name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.anna_heating_setpoint-entry] +# name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.anna_temperature-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -4334,7 +4387,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': , - 'entity_id': 'sensor.anna_heating_setpoint', + 'entity_id': 'sensor.anna_temperature', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -4349,33 +4402,33 @@ }), 'original_device_class': , 'original_icon': None, - 'original_name': 'Heating setpoint', + 'original_name': 'Temperature', 'platform': 'plugwise', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': 'heating_setpoint', - 'unique_id': '3cb70739631c4d17a86b8b12e8a5161b-setpoint_low', + 'translation_key': None, + 'unique_id': '3cb70739631c4d17a86b8b12e8a5161b-temperature', 'unit_of_measurement': , }) # --- -# name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.anna_heating_setpoint-state] +# name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.anna_temperature-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'temperature', - 'friendly_name': 'Anna Heating setpoint', + 'friendly_name': 'Anna Temperature', 'state_class': , 'unit_of_measurement': , }), 'context': , - 'entity_id': 'sensor.anna_heating_setpoint', + 'entity_id': 'sensor.anna_temperature', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': '20.5', + 'state': '19.3', }) # --- -# name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.anna_illuminance-entry] +# name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.living_room_cooling_setpoint-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -4390,7 +4443,7 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': , - 'entity_id': 'sensor.anna_illuminance', + 'entity_id': 'sensor.living_room_cooling_setpoint', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -4399,36 +4452,39 @@ }), 'name': None, 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 1, + }), }), - 'original_device_class': , + 'original_device_class': , 'original_icon': None, - 'original_name': 'Illuminance', + 'original_name': 'Cooling setpoint', 'platform': 'plugwise', 'previous_unique_id': None, 'suggested_object_id': None, 'supported_features': 0, - 'translation_key': None, - 'unique_id': '3cb70739631c4d17a86b8b12e8a5161b-illuminance', - 'unit_of_measurement': 'lx', + 'translation_key': 'cooling_setpoint', + 'unique_id': 'c784ee9fdab44e1395b8dee7d7a497d5-setpoint_high', + 'unit_of_measurement': , }) # --- -# name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.anna_illuminance-state] +# name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.living_room_cooling_setpoint-state] StateSnapshot({ 'attributes': ReadOnlyDict({ - 'device_class': 'illuminance', - 'friendly_name': 'Anna Illuminance', + 'device_class': 'temperature', + 'friendly_name': 'Living room Cooling setpoint', 'state_class': , - 'unit_of_measurement': 'lx', + 'unit_of_measurement': , }), 'context': , - 'entity_id': 'sensor.anna_illuminance', + 'entity_id': 'sensor.living_room_cooling_setpoint', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': '86.0', + 'state': '30.0', }) # --- -# name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.anna_temperature-entry] +# name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.living_room_heating_setpoint-entry] EntityRegistryEntrySnapshot({ 'aliases': set({ }), @@ -4443,7 +4499,63 @@ 'disabled_by': None, 'domain': 'sensor', 'entity_category': , - 'entity_id': 'sensor.anna_temperature', + 'entity_id': 'sensor.living_room_heating_setpoint', + 'has_entity_name': True, + 'hidden_by': None, + 'icon': None, + 'id': , + 'labels': set({ + }), + 'name': None, + 'options': dict({ + 'sensor': dict({ + 'suggested_display_precision': 1, + }), + }), + 'original_device_class': , + 'original_icon': None, + 'original_name': 'Heating setpoint', + 'platform': 'plugwise', + 'previous_unique_id': None, + 'suggested_object_id': None, + 'supported_features': 0, + 'translation_key': 'heating_setpoint', + 'unique_id': 'c784ee9fdab44e1395b8dee7d7a497d5-setpoint_low', + 'unit_of_measurement': , + }) +# --- +# name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.living_room_heating_setpoint-state] + StateSnapshot({ + 'attributes': ReadOnlyDict({ + 'device_class': 'temperature', + 'friendly_name': 'Living room Heating setpoint', + 'state_class': , + 'unit_of_measurement': , + }), + 'context': , + 'entity_id': 'sensor.living_room_heating_setpoint', + 'last_changed': , + 'last_reported': , + 'last_updated': , + 'state': '20.5', + }) +# --- +# name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.living_room_temperature-entry] + EntityRegistryEntrySnapshot({ + 'aliases': set({ + }), + 'area_id': None, + 'capabilities': dict({ + 'state_class': , + }), + 'config_entry_id': , + 'config_subentry_id': , + 'device_class': None, + 'device_id': , + 'disabled_by': None, + 'domain': 'sensor', + 'entity_category': , + 'entity_id': 'sensor.living_room_temperature', 'has_entity_name': True, 'hidden_by': None, 'icon': None, @@ -4464,24 +4576,24 @@ 'suggested_object_id': None, 'supported_features': 0, 'translation_key': None, - 'unique_id': '3cb70739631c4d17a86b8b12e8a5161b-temperature', + 'unique_id': 'c784ee9fdab44e1395b8dee7d7a497d5-temperature', 'unit_of_measurement': , }) # --- -# name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.anna_temperature-state] +# name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.living_room_temperature-state] StateSnapshot({ 'attributes': ReadOnlyDict({ 'device_class': 'temperature', - 'friendly_name': 'Anna Temperature', + 'friendly_name': 'Living room Temperature', 'state_class': , 'unit_of_measurement': , }), 'context': , - 'entity_id': 'sensor.anna_temperature', + 'entity_id': 'sensor.living_room_temperature', 'last_changed': , 'last_reported': , 'last_updated': , - 'state': '19.3', + 'state': '23.3', }) # --- # name: test_anna_sensor_snapshot[platforms0-True-anna_heatpump_heating][sensor.opentherm_dhw_temperature-entry] diff --git a/tests/components/plugwise/test_climate.py b/tests/components/plugwise/test_climate.py index e3cb4fa20..e339a77df 100644 --- a/tests/components/plugwise/test_climate.py +++ b/tests/components/plugwise/test_climate.py @@ -393,7 +393,7 @@ async def test_anna_climate_entity_climate_changes( CLIMATE_DOMAIN, SERVICE_SET_TEMPERATURE, { - ATTR_ENTITY_ID: "climate.anna", + ATTR_ENTITY_ID: "climate.living_room", ATTR_TARGET_TEMP_HIGH: 30, ATTR_TARGET_TEMP_LOW: 20, }, @@ -408,7 +408,7 @@ async def test_anna_climate_entity_climate_changes( await hass.services.async_call( CLIMATE_DOMAIN, SERVICE_SET_PRESET_MODE, - {ATTR_ENTITY_ID: "climate.anna", ATTR_PRESET_MODE: PRESET_AWAY}, + {ATTR_ENTITY_ID: "climate.living_room", ATTR_PRESET_MODE: PRESET_AWAY}, blocking=True, ) assert mock_smile_anna.set_preset.call_count == 1 @@ -419,7 +419,7 @@ async def test_anna_climate_entity_climate_changes( await hass.services.async_call( CLIMATE_DOMAIN, SERVICE_SET_HVAC_MODE, - {ATTR_ENTITY_ID: "climate.anna", ATTR_HVAC_MODE: HVACMode.AUTO}, + {ATTR_ENTITY_ID: "climate.living_room", ATTR_HVAC_MODE: HVACMode.AUTO}, blocking=True, ) # hvac_mode is already auto so not called. @@ -428,7 +428,7 @@ async def test_anna_climate_entity_climate_changes( await hass.services.async_call( CLIMATE_DOMAIN, SERVICE_SET_HVAC_MODE, - {ATTR_ENTITY_ID: "climate.anna", ATTR_HVAC_MODE: HVACMode.HEAT_COOL}, + {ATTR_ENTITY_ID: "climate.living_room", ATTR_HVAC_MODE: HVACMode.HEAT_COOL}, blocking=True, ) assert mock_smile_anna.set_schedule_state.call_count == 1 @@ -438,15 +438,15 @@ async def test_anna_climate_entity_climate_changes( # Mock user deleting last schedule from app or browser data = mock_smile_anna.async_update.return_value - data["3cb70739631c4d17a86b8b12e8a5161b"]["available_schedules"] = [] - data["3cb70739631c4d17a86b8b12e8a5161b"]["select_schedule"] = None - data["3cb70739631c4d17a86b8b12e8a5161b"]["climate_mode"] = "heat_cool" + data["c784ee9fdab44e1395b8dee7d7a497d5"]["available_schedules"] = [] + data["c784ee9fdab44e1395b8dee7d7a497d5"]["select_schedule"] = None + data["c784ee9fdab44e1395b8dee7d7a497d5"]["climate_mode"] = "heat_cool" with patch(HA_PLUGWISE_SMILE_ASYNC_UPDATE, return_value=data): freezer.tick(timedelta(minutes=1)) async_fire_time_changed(hass) await hass.async_block_till_done() - state = hass.states.get("climate.anna") + state = hass.states.get("climate.living_room") assert state.state == HVACMode.HEAT_COOL assert state.attributes[ATTR_HVAC_MODES] == [HVACMode.HEAT_COOL] diff --git a/tests/components/plugwise/test_select.py b/tests/components/plugwise/test_select.py index e79c0738f..f1aaf7afd 100644 --- a/tests/components/plugwise/test_select.py +++ b/tests/components/plugwise/test_select.py @@ -120,7 +120,7 @@ async def test_anna_select_unavailable_schedule_mode( SELECT_DOMAIN, SERVICE_SELECT_OPTION, { - ATTR_ENTITY_ID: "select.anna_thermostat_schedule", + ATTR_ENTITY_ID: "select.living_room_thermostat_schedule", ATTR_OPTION: "Winter", }, blocking=True,