mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 21:27:38 +00:00
Remove deprecated MyZone service in Advantage Air (#75160)
This commit is contained in:
parent
a287abe763
commit
ea354f3d5f
@ -15,7 +15,6 @@ from homeassistant.components.climate.const import (
|
|||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import ATTR_TEMPERATURE, PRECISION_WHOLE, TEMP_CELSIUS
|
from homeassistant.const import ATTR_TEMPERATURE, PRECISION_WHOLE, TEMP_CELSIUS
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import entity_platform
|
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
|
|
||||||
from .const import (
|
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()}
|
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}
|
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]
|
ZONE_HVAC_MODES = [HVACMode.OFF, HVACMode.HEAT_COOL]
|
||||||
|
|
||||||
PARALLEL_UPDATES = 0
|
PARALLEL_UPDATES = 0
|
||||||
@ -79,13 +77,6 @@ async def async_setup_entry(
|
|||||||
entities.append(AdvantageAirZone(instance, ac_key, zone_key))
|
entities.append(AdvantageAirZone(instance, ac_key, zone_key))
|
||||||
async_add_entities(entities)
|
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):
|
class AdvantageAirAC(AdvantageAirAcEntity, ClimateEntity):
|
||||||
"""AdvantageAir AC unit."""
|
"""AdvantageAir AC unit."""
|
||||||
@ -213,12 +204,3 @@ class AdvantageAirZone(AdvantageAirZoneEntity, ClimateEntity):
|
|||||||
await self.async_change(
|
await self.async_change(
|
||||||
{self.ac_key: {"zones": {self.zone_key: {"setTemp": temp}}}}
|
{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"]}}}
|
|
||||||
)
|
|
||||||
|
@ -15,11 +15,3 @@ set_time_to:
|
|||||||
min: 0
|
min: 0
|
||||||
max: 1440
|
max: 1440
|
||||||
unit_of_measurement: minutes
|
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
|
|
||||||
|
@ -2,14 +2,12 @@
|
|||||||
from json import loads
|
from json import loads
|
||||||
|
|
||||||
from homeassistant.components.advantage_air.climate import (
|
from homeassistant.components.advantage_air.climate import (
|
||||||
ADVANTAGE_AIR_SERVICE_SET_MYZONE,
|
|
||||||
HASS_FAN_MODES,
|
HASS_FAN_MODES,
|
||||||
HASS_HVAC_MODES,
|
HASS_HVAC_MODES,
|
||||||
)
|
)
|
||||||
from homeassistant.components.advantage_air.const import (
|
from homeassistant.components.advantage_air.const import (
|
||||||
ADVANTAGE_AIR_STATE_OFF,
|
ADVANTAGE_AIR_STATE_OFF,
|
||||||
ADVANTAGE_AIR_STATE_ON,
|
ADVANTAGE_AIR_STATE_ON,
|
||||||
DOMAIN as ADVANTAGE_AIR_DOMAIN,
|
|
||||||
)
|
)
|
||||||
from homeassistant.components.climate.const import (
|
from homeassistant.components.climate.const import (
|
||||||
ATTR_FAN_MODE,
|
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][0] == "GET"
|
||||||
assert aioclient_mock.mock_calls[-1][1].path == "/getSystemData"
|
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):
|
async def test_climate_async_failed_update(hass, aioclient_mock):
|
||||||
"""Test climate change failure."""
|
"""Test climate change failure."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user