Skip to content

Commit

Permalink
fix: 修复网页控制台设置页面保存报错
Browse files Browse the repository at this point in the history
  • Loading branch information
hanxi committed Jul 6, 2024
1 parent 7da8059 commit 202105a
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions xiaomusic/xiaomusic.py
Original file line number Diff line number Diff line change
Expand Up @@ -1051,14 +1051,17 @@ async def reinit(self, **kwargs):
async def getalldevices(self, **kwargs):
did_list = []
hardware_list = []
hardware_data = await self.mina_service.device_list()
for h in hardware_data:
did = h.get("miotDID", "")
if did != "":
did_list.append(did)
hardware = h.get("hardware", "")
if h.get("hardware", "") != "":
hardware_list.append(hardware)
try:
hardware_data = await self.mina_service.device_list()
for h in hardware_data:
did = h.get("miotDID", "")
if did != "":
did_list.append(did)
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,
Expand Down

0 comments on commit 202105a

Please sign in to comment.