2
2
3
3
from __future__ import annotations
4
4
5
+ from typing import Literal
6
+
5
7
from ...feature import Feature
6
8
from ..smartmodule import SmartModule
7
9
@@ -94,7 +96,7 @@ def _initialize_features(self):
94
96
)
95
97
96
98
@property
97
- def alarm_sound (self ):
99
+ def alarm_sound (self ) -> str :
98
100
"""Return current alarm sound."""
99
101
return self .data ["get_alarm_configure" ]["type" ]
100
102
@@ -113,11 +115,11 @@ def alarm_sounds(self) -> list[str]:
113
115
return self .data ["get_support_alarm_type_list" ]["alarm_type_list" ]
114
116
115
117
@property
116
- def alarm_volume (self ):
118
+ def alarm_volume (self ) -> Literal [ "low" , "normal" , "high" ] :
117
119
"""Return alarm volume."""
118
120
return self .data ["get_alarm_configure" ]["volume" ]
119
121
120
- async def set_alarm_volume (self , volume : str ):
122
+ async def set_alarm_volume (self , volume : Literal [ "low" , "normal" , "high" ] ):
121
123
"""Set alarm volume."""
122
124
payload = self .data ["get_alarm_configure" ].copy ()
123
125
payload ["volume" ] = volume
@@ -134,10 +136,10 @@ def source(self) -> str | None:
134
136
src = self ._device .sys_info ["in_alarm_source" ]
135
137
return src if src else None
136
138
137
- async def play (self ):
139
+ async def play (self ) -> dict :
138
140
"""Play alarm."""
139
141
return await self .call ("play_alarm" )
140
142
141
- async def stop (self ):
143
+ async def stop (self ) -> dict :
142
144
"""Stop alarm."""
143
145
return await self .call ("stop_alarm" )
0 commit comments