1
mirror of https://github.com/home-assistant/core synced 2024-08-02 23:40:32 +02:00

Add warning when calling deprecated bond services (#64744)

This commit is contained in:
J. Nick Koston 2022-01-22 22:24:40 -10:00 committed by GitHub
parent 2ed30ac361
commit 3360a95156
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 3 deletions

View File

@ -199,6 +199,9 @@ class BondLight(BondBaseLight, BondEntity, LightEntity):
async def async_start_increasing_brightness(self) -> None:
"""Start increasing the light brightness."""
_LOGGER.warning(
"The bond.start_increasing_brightness service is deprecated and has been replaced with a button; Call the button.press service instead"
)
self._async_has_action_or_raise(Action.START_INCREASING_BRIGHTNESS)
await self._hub.bond.action(
self._device.device_id, Action(Action.START_INCREASING_BRIGHTNESS)
@ -206,6 +209,9 @@ class BondLight(BondBaseLight, BondEntity, LightEntity):
async def async_start_decreasing_brightness(self) -> None:
"""Start decreasing the light brightness."""
_LOGGER.warning(
"The bond.start_decreasing_brightness service is deprecated and has been replaced with a button; Call the button.press service instead"
)
self._async_has_action_or_raise(Action.START_DECREASING_BRIGHTNESS)
await self._hub.bond.action(
self._device.device_id, Action(Action.START_DECREASING_BRIGHTNESS)
@ -213,6 +219,9 @@ class BondLight(BondBaseLight, BondEntity, LightEntity):
async def async_stop(self) -> None:
"""Stop all actions and clear the queue."""
_LOGGER.warning(
"The bond.stop service is deprecated and has been replaced with a button; Call the button.press service instead"
)
self._async_has_action_or_raise(Action.STOP)
await self._hub.bond.action(self._device.device_id, Action(Action.STOP))

View File

@ -94,7 +94,7 @@ set_light_brightness_tracked_state:
start_increasing_brightness:
name: Start increasing brightness
description: "Start increasing the brightness of the light."
description: "Start increasing the brightness of the light. (deprecated)"
target:
entity:
integration: bond
@ -102,7 +102,7 @@ start_increasing_brightness:
start_decreasing_brightness:
name: Start decreasing brightness
description: "Start decreasing the brightness of the light."
description: "Start decreasing the brightness of the light. (deprecated)"
target:
entity:
integration: bond
@ -110,7 +110,7 @@ start_decreasing_brightness:
stop:
name: Stop
description: "Stop any in-progress action and empty the queue."
description: "Stop any in-progress action and empty the queue. (deprecated)"
target:
entity:
integration: bond