本帖最后由 guyue2005 于 2023-3-21 11:03 编辑
我的日志里面能发现设备,但是没有实体和卡片,是啥原因呢,云控二代
2023-03-15 14:19:45.916 ERROR (Thread-2 (socket_listen)) [root] Uncaught thread exception
Traceback (most recent call last):
File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/config/custom_components/gree2/climate.py", line 206, in socket_listen
self.devMap[item_mac] = Gree2Climate(self.hass, item['name'] + item_mac, item['mid'], item_mac, self, self._temp_sensor.get(item_mac))
KeyError: 'name'
复制代码
这里就报错了,应该是抓取不到名字。把
self.devMap[item_mac] = Gree2Climate(self.hass, item['name'] + item_mac, item['mid'], item_mac, self, self._temp_sensor.get(item_mac))
复制代码
改成
self.devMap[item_mac] = Gree2Climate(self.hass, self.name + item_mac, item['mid'], item_mac, self, self._temp_sensor.get(item_mac))
复制代码
临时解决问题,能正常读取到实体