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

Remove previously deprecated ISY994 services #91569

Merged
merged 1 commit into from
Apr 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
41 changes: 1 addition & 40 deletions homeassistant/components/isy994/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,13 @@
from homeassistant.components.light import ColorMode, LightEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant, ServiceCall, callback
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
import homeassistant.helpers.entity_registry as er
from homeassistant.helpers.restore_state import RestoreEntity

from .const import _LOGGER, CONF_RESTORE_LIGHT_STATE, DOMAIN, UOM_PERCENTAGE
from .entity import ISYNodeEntity
from .services import (
SERVICE_SET_ON_LEVEL,
async_log_deprecated_service_call,
async_setup_light_services,
)

ATTR_LAST_BRIGHTNESS = "last_brightness"

Expand All @@ -43,7 +37,6 @@ async def async_setup_entry(
)

async_add_entities(entities)
async_setup_light_services(hass)


class ISYLightEntity(ISYNodeEntity, LightEntity, RestoreEntity):
Expand Down Expand Up @@ -127,35 +120,3 @@ async def async_added_to_hass(self) -> None:
and last_state.attributes[ATTR_LAST_BRIGHTNESS]
):
self._last_brightness = last_state.attributes[ATTR_LAST_BRIGHTNESS]

async def async_set_on_level(self, value: int) -> None:
"""Set the ON Level for a device."""
entity_registry = er.async_get(self.hass)
async_log_deprecated_service_call(
self.hass,
call=ServiceCall(domain=DOMAIN, service=SERVICE_SET_ON_LEVEL),
alternate_service="number.set_value",
alternate_target=entity_registry.async_get_entity_id(
Platform.NUMBER,
DOMAIN,
f"{self._node.isy.uuid}_{self._node.address}_OL",
),
breaks_in_ha_version="2023.5.0",
)
await self._node.set_on_level(value)

async def async_set_ramp_rate(self, value: int) -> None:
"""Set the Ramp Rate for a device."""
entity_registry = er.async_get(self.hass)
async_log_deprecated_service_call(
self.hass,
call=ServiceCall(domain=DOMAIN, service=SERVICE_SET_ON_LEVEL),
alternate_service="select.select_option",
alternate_target=entity_registry.async_get_entity_id(
Platform.NUMBER,
DOMAIN,
f"{self._node.isy.uuid}_{self._node.address}_RR",
),
breaks_in_ha_version="2023.5.0",
)
await self._node.set_ramp_rate(value)