Allow passing alarm parameter overrides (#1340)

Allows specifying alarm parameters duration, volume and sound.
Adds new feature: `alarm_duration`.
Breaking change to `alarm_volume' on the `smart.Alarm` module is changed from `str` to `int`
Co-authored-by: Steven B <51370195+sdb9696@users.noreply.github.com>
This commit is contained in:
Teemu R.
2025-01-26 14:13:09 +01:00
committed by GitHub
parent 62c1dd87dc
commit d857cc68bb
3 changed files with 258 additions and 20 deletions

View File

@@ -134,11 +134,9 @@ class FakeSmartTransport(BaseTransport):
"get_alarm_configure": (
"alarm",
{
"get_alarm_configure": {
"duration": 10,
"type": "Doorbell Ring 2",
"volume": "low",
}
"duration": 10,
"type": "Doorbell Ring 2",
"volume": "low",
},
),
"get_support_alarm_type_list": (
@@ -672,7 +670,7 @@ class FakeSmartTransport(BaseTransport):
self.fixture_name, set()
).add(method)
return retval
elif method in ["set_qs_info", "fw_download"]:
elif method in ["set_qs_info", "fw_download", "play_alarm", "stop_alarm"]:
return {"error_code": 0}
elif method == "set_dynamic_light_effect_rule_enable":
self._set_dynamic_light_effect(info, params)