Deprecate is_something attributes (#912)

Deprecates the is_something attributes like is_bulb and is_dimmable in favour of the modular approach.
This commit is contained in:
Steven B
2024-05-13 18:52:08 +01:00
committed by GitHub
parent 33d839866e
commit ef49f44eac
8 changed files with 142 additions and 93 deletions

View File

@@ -208,7 +208,7 @@ async def test_non_variable_temp(dev: Device):
async def test_dimmable_brightness(dev: IotBulb, turn_on):
assert isinstance(dev, (IotBulb, IotDimmer))
await handle_turn_on(dev, turn_on)
assert dev.is_dimmable
assert dev._is_dimmable
await dev.set_brightness(50)
await dev.update()
@@ -244,7 +244,7 @@ async def test_dimmable_brightness_transition(dev: IotBulb, mocker):
@dimmable_iot
async def test_invalid_brightness(dev: IotBulb):
assert dev.is_dimmable
assert dev._is_dimmable
with pytest.raises(ValueError):
await dev.set_brightness(110)
@@ -255,7 +255,7 @@ async def test_invalid_brightness(dev: IotBulb):
@non_dimmable_iot
async def test_non_dimmable(dev: IotBulb):
assert not dev.is_dimmable
assert not dev._is_dimmable
with pytest.raises(KasaException):
assert dev.brightness == 0