diff --git a/kasa/smart/modules/alarm.py b/kasa/smart/modules/alarm.py index a6ba8181..7a945b9b 100644 --- a/kasa/smart/modules/alarm.py +++ b/kasa/smart/modules/alarm.py @@ -197,14 +197,14 @@ class Alarm(SmartModule): def _check_volume(self, volume: str) -> None: """Raise an exception on invalid volume.""" if volume not in ["low", "normal", "high"]: - raise ValueError(f"Invalid volume {volume} [low, normal, high]") + raise ValueError(f"Invalid volume {volume} available: low, normal, high") def _check_duration(self, duration: int) -> None: """Raise an exception on invalid duration.""" if duration < 1 or duration > 10 * 60: - raise ValueError(f"Invalid duration {duration} (wanted: 1-600)") + raise ValueError(f"Invalid duration {duration} available: 1-600") def _check_sound(self, sound: str) -> None: """Raise an exception on invalid sound.""" if sound not in self.alarm_sounds: - raise ValueError(f"Invalid sound {sound} [{self.alarm_sounds}]") + raise ValueError(f"Invalid sound {sound} available: {self.alarm_sounds}") diff --git a/tests/smart/modules/test_alarm.py b/tests/smart/modules/test_alarm.py index 2a8a046c..89b889b8 100644 --- a/tests/smart/modules/test_alarm.py +++ b/tests/smart/modules/test_alarm.py @@ -41,7 +41,9 @@ async def test_features(dev: SmartDevice, feature: str, prop_name: str, type: ty [ pytest.param({"volume": "low"}, {"alarm_volume": "low"}, id="volume"), pytest.param({"duration": 1}, {"alarm_duration": 1}, id="duration"), - pytest.param({"sound": "Alarm 1"}, {"alarm_type": "Alarm 1"}, id="sound"), + pytest.param( + {"sound": "Alarm 1"}, {"alarm_type": "Doorbell Ring 1"}, id="sound" + ), ], ) async def test_play(dev: SmartDevice, kwargs, request_params, mocker: MockerFixture): @@ -67,7 +69,9 @@ async def test_stop(dev: SmartDevice, mocker: MockerFixture): @pytest.mark.parametrize( ("method", "value", "target_key"), [ - pytest.param("set_alarm_sound", "Alarm 1", "type", id="set_alarm_sound"), + pytest.param( + "set_alarm_sound", "Doorbell Ring 1", "type", id="set_alarm_sound" + ), pytest.param("set_alarm_volume", "low", "volume", id="set_alarm_volume"), pytest.param("set_alarm_duration", 10, "duration", id="set_alarm_duration"), ],