zha-ng / zha-map

Build ZHA network topology map.
MIT License
57 stars 17 forks source link

AttributeError: 'Weather' object has no attribute 'neighbors' #33

Closed Itzamna44 closed 4 years ago

Itzamna44 commented 4 years ago

Hello. ZHA-MAP is not worked on 0.114.4? I have this error: 2020-10-01 12:03:19 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.2880318360] 'Weather' object has no attribute 'neighbors' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 125, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1308, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1343, in _execute_service await handler.func(service_call) File "/config/custom_components/zha_map/__init__.py", line 66, in scan_now_handler await builder.preempt_build() File "/config/custom_components/zha_map/__init__.py", line 125, in preempt_build await self.build() File "/config/custom_components/zha_map/__init__.py", line 138, in build nei = await Neighbour.scan_device(device) File "/config/custom_components/zha_map/neighbour.py", line 78, in scan_device await r.scan() File "/config/custom_components/zha_map/neighbour.py", line 83, in scan for neighbor in self.device.neighbors: AttributeError: 'Weather' object has no attribute 'neighbors'

ielbury commented 4 years ago

My error is slightly different with 116.b1 and the latest zha_map from github:

2020-10-01 20:09:42 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.139923240442416] 'Neighbor' object has no attribute 'struct'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 138, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 1335, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1370, in _execute_service
    await handler.func(service_call)
  File "/config/custom_components/zha_map/__init__.py", line 66, in scan_now_handler
    await builder.preempt_build()
  File "/config/custom_components/zha_map/__init__.py", line 125, in preempt_build
    await self.build()
  File "/config/custom_components/zha_map/__init__.py", line 138, in build
    nei = await Neighbour.scan_device(device)
  File "/config/custom_components/zha_map/neighbour.py", line 78, in scan_device
    await r.scan()
  File "/config/custom_components/zha_map/neighbour.py", line 84, in scan
    new = self.new_from_record(neighbor.neighbor)
  File "/config/custom_components/zha_map/neighbour.py", line 46, in new_from_record
    r.device_type = record.struct.device_type.name
AttributeError: 'Neighbor' object has no attribute 'struct'
Adminiuga commented 4 years ago

fixed in 0.4.0