fix:电脑不支持iot音量控制bug

This commit is contained in:
hrz 2025-03-18 13:15:51 +08:00
parent a174a54633
commit 527b4f970e

View file

@ -49,6 +49,8 @@ def raise_and_lower_the_volume(conn, action: str):
async def _raise_and_lower_the_volume(conn, action):
volume = await get_iot_status(conn, "Speaker", "volume")
if volume is None:
raise Exception("你的设备不支持音量控制")
if action == 'raise':
volume += 10
elif action == 'lower':