From ea354f3d5fb4ec04f740c0fb416bb0c355aa3eaa Mon Sep 17 00:00:00 2001 From: Brett Adams Date: Tue, 26 Jul 2022 07:56:36 +1000 Subject: [PATCH] Remove deprecated MyZone service in Advantage Air (#75160) --- .../components/advantage_air/climate.py | 18 ------------------ .../components/advantage_air/services.yaml | 8 -------- tests/components/advantage_air/test_climate.py | 17 ----------------- 3 files changed, 43 deletions(-) diff --git a/homeassistant/components/advantage_air/climate.py b/homeassistant/components/advantage_air/climate.py index db060e739b1..e69dc06dd7d 100644 --- a/homeassistant/components/advantage_air/climate.py +++ b/homeassistant/components/advantage_air/climate.py @@ -15,7 +15,6 @@ from homeassistant.components.climate.const import ( from homeassistant.config_entries import ConfigEntry from homeassistant.const import ATTR_TEMPERATURE, PRECISION_WHOLE, TEMP_CELSIUS from homeassistant.core import HomeAssistant -from homeassistant.helpers import entity_platform from homeassistant.helpers.entity_platform import AddEntitiesCallback from .const import ( @@ -53,7 +52,6 @@ ADVANTAGE_AIR_FAN_MODES = { HASS_FAN_MODES = {v: k for k, v in ADVANTAGE_AIR_FAN_MODES.items()} FAN_SPEEDS = {FAN_LOW: 30, FAN_MEDIUM: 60, FAN_HIGH: 100} -ADVANTAGE_AIR_SERVICE_SET_MYZONE = "set_myzone" ZONE_HVAC_MODES = [HVACMode.OFF, HVACMode.HEAT_COOL] PARALLEL_UPDATES = 0 @@ -79,13 +77,6 @@ async def async_setup_entry( entities.append(AdvantageAirZone(instance, ac_key, zone_key)) async_add_entities(entities) - platform = entity_platform.async_get_current_platform() - platform.async_register_entity_service( - ADVANTAGE_AIR_SERVICE_SET_MYZONE, - {}, - "set_myzone", - ) - class AdvantageAirAC(AdvantageAirAcEntity, ClimateEntity): """AdvantageAir AC unit.""" @@ -213,12 +204,3 @@ class AdvantageAirZone(AdvantageAirZoneEntity, ClimateEntity): await self.async_change( {self.ac_key: {"zones": {self.zone_key: {"setTemp": temp}}}} ) - - async def set_myzone(self, **kwargs): - """Set this zone as the 'MyZone'.""" - _LOGGER.warning( - "The advantage_air.set_myzone service has been deprecated and will be removed in a future version, please use the select.select_option service on the MyZone entity" - ) - await self.async_change( - {self.ac_key: {"info": {"myZone": self._zone["number"]}}} - ) diff --git a/homeassistant/components/advantage_air/services.yaml b/homeassistant/components/advantage_air/services.yaml index 38f21e57128..6bd3bf815d6 100644 --- a/homeassistant/components/advantage_air/services.yaml +++ b/homeassistant/components/advantage_air/services.yaml @@ -15,11 +15,3 @@ set_time_to: min: 0 max: 1440 unit_of_measurement: minutes - -set_myzone: - name: Set MyZone - description: Change which zone is set as the reference for temperature control (deprecated) - target: - entity: - integration: advantage_air - domain: climate diff --git a/tests/components/advantage_air/test_climate.py b/tests/components/advantage_air/test_climate.py index 6ee0a614b09..f1b118ab3b3 100644 --- a/tests/components/advantage_air/test_climate.py +++ b/tests/components/advantage_air/test_climate.py @@ -2,14 +2,12 @@ from json import loads from homeassistant.components.advantage_air.climate import ( - ADVANTAGE_AIR_SERVICE_SET_MYZONE, HASS_FAN_MODES, HASS_HVAC_MODES, ) from homeassistant.components.advantage_air.const import ( ADVANTAGE_AIR_STATE_OFF, ADVANTAGE_AIR_STATE_ON, - DOMAIN as ADVANTAGE_AIR_DOMAIN, ) from homeassistant.components.climate.const import ( ATTR_FAN_MODE, @@ -170,21 +168,6 @@ async def test_climate_async_setup_entry(hass, aioclient_mock): assert aioclient_mock.mock_calls[-1][0] == "GET" assert aioclient_mock.mock_calls[-1][1].path == "/getSystemData" - # Test set_myair service - await hass.services.async_call( - ADVANTAGE_AIR_DOMAIN, - ADVANTAGE_AIR_SERVICE_SET_MYZONE, - {ATTR_ENTITY_ID: [entity_id]}, - blocking=True, - ) - assert len(aioclient_mock.mock_calls) == 17 - assert aioclient_mock.mock_calls[-2][0] == "GET" - assert aioclient_mock.mock_calls[-2][1].path == "/setAircon" - data = loads(aioclient_mock.mock_calls[-2][1].query["json"]) - assert data["ac1"]["info"]["myZone"] == 1 - assert aioclient_mock.mock_calls[-1][0] == "GET" - assert aioclient_mock.mock_calls[-1][1].path == "/getSystemData" - async def test_climate_async_failed_update(hass, aioclient_mock): """Test climate change failure."""