mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-11-17 07:38:42 +00:00
Add mute volume and allow passing volume as integer
This commit is contained in:
@@ -40,6 +40,7 @@ async def test_features(dev: SmartDevice, feature: str, prop_name: str, type: ty
|
||||
("kwargs", "request_params"),
|
||||
[
|
||||
pytest.param({"volume": "low"}, {"alarm_volume": "low"}, id="volume"),
|
||||
pytest.param({"volume": 0}, {"alarm_volume": "mute"}, id="volume-integer"),
|
||||
pytest.param({"duration": 1}, {"alarm_duration": 1}, id="duration"),
|
||||
pytest.param(
|
||||
{"sound": "Doorbell Ring 1"}, {"alarm_type": "Doorbell Ring 1"}, id="sound"
|
||||
@@ -63,6 +64,9 @@ async def test_play(dev: SmartDevice, kwargs, request_params, mocker: MockerFixt
|
||||
with pytest.raises(ValueError, match="Invalid volume"):
|
||||
await alarm.play(volume="unknown") # type: ignore[arg-type]
|
||||
|
||||
with pytest.raises(ValueError, match="Invalid volume"):
|
||||
await alarm.play(volume=-1)
|
||||
|
||||
|
||||
@alarm
|
||||
async def test_stop(dev: SmartDevice, mocker: MockerFixture):
|
||||
|
||||
Reference in New Issue
Block a user