mirror of
https://github.com/xinnan-tech/xiaozhi-esp32-server.git
synced 2026-11-29 05:09:46 +01:00
fix:电脑不支持iot音量控制bug
This commit is contained in:
parent
a174a54633
commit
527b4f970e
1 changed files with 2 additions and 0 deletions
|
|
@ -49,6 +49,8 @@ def raise_and_lower_the_volume(conn, action: str):
|
||||||
|
|
||||||
async def _raise_and_lower_the_volume(conn, action):
|
async def _raise_and_lower_the_volume(conn, action):
|
||||||
volume = await get_iot_status(conn, "Speaker", "volume")
|
volume = await get_iot_status(conn, "Speaker", "volume")
|
||||||
|
if volume is None:
|
||||||
|
raise Exception("你的设备不支持音量控制")
|
||||||
if action == 'raise':
|
if action == 'raise':
|
||||||
volume += 10
|
volume += 10
|
||||||
elif action == 'lower':
|
elif action == 'lower':
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue