fix: 修复网页控制台设置页面保存报错

This commit is contained in:
涵曦 2024-07-06 16:04:07 +00:00
parent 7da80594e3
commit 202105a11f

View File

@ -1051,6 +1051,7 @@ class XiaoMusic:
async def getalldevices(self, **kwargs):
did_list = []
hardware_list = []
try:
hardware_data = await self.mina_service.device_list()
for h in hardware_data:
did = h.get("miotDID", "")
@ -1059,6 +1060,8 @@ class XiaoMusic:
hardware = h.get("hardware", "")
if h.get("hardware", "") != "":
hardware_list.append(hardware)
except Exception as e:
self.log.error(f"Execption {e}")
alldevices = {
"did_list": did_list,
"hardware_list": hardware_list,