doudz / homeassistant-zigate

zigate component for Home Assistant
MIT License
48 stars 15 forks source link

zigate.upgrade_firmware not working #104

Closed ruimarinho closed 4 years ago

ruimarinho commented 4 years ago

Hi @doudz,

Tried giving zigate.upgrade_firmware a test but I was unable to successfully execute it. First, I called zigate.stop_device and then called the upgrade function, but this was the output:

58055872-2020-02-23 16:14:12 DEBUG (SyncWorker_12) [zigate] Saving persistent file
58055946-2020-02-23 16:14:12 DEBUG (SyncWorker_12) [zigate] Acquire Lock to save persistent file
58056034-2020-02-23 16:14:12 DEBUG (SyncWorker_12) [zigate] Release Lock of persistent file
58056117:2020-02-23 16:15:35 DEBUG (SyncWorker_11) [zigate.flasher] Command 7 None False
58056197:2020-02-23 16:15:35 DEBUG (SyncWorker_11) [zigate.flasher] Command 9 None True
58056276:2020-02-23 16:15:35 DEBUG (SyncWorker_11) [zigate.flasher] Command 11 <LH False
58056356:2020-02-23 16:15:35 DEBUG (SyncWorker_11) [zigate.flasher] Command 31 <LH False
58056436:2020-02-23 16:15:35 DEBUG (SyncWorker_11) [zigate.flasher] Command 37 None False
58056517:2020-02-23 16:15:35 DEBUG (SyncWorker_11) [zigate.flasher] Command 39 !B False
58056596:2020-02-23 16:15:35 DEBUG (SyncWorker_11) [zigate.flasher] Command 44 <BL False
58056676:2020-02-23 16:15:35 DEBUG (SyncWorker_11) [zigate.flasher] Command 50 None False
58056757:2020-02-23 16:15:35 DEBUG (SyncWorker_11) [zigate.flasher] Command 54 B False
58056835-2020-02-23 16:15:35 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection.140424264255504] 'NoneType' object has no attribute '_port'
58056990-Traceback (most recent call last):
58057025-  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 134, in handle_call_service
58057142-    connection.context(msg),
58057171-  File "/usr/src/homeassistant/homeassistant/core.py", line 1226, in async_call
58057251-    await asyncio.shield(self._execute_service(handler, service_call))
58057322-  File "/usr/src/homeassistant/homeassistant/core.py", line 1253, in _execute_service
58057408-    await self._hass.async_add_executor_job(handler.func, service_call)
58057480-  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
58057560-    result = self.fn(*self.args, **self.kwargs)
58057608-  File "/config/custom_components/zigate/__init__.py", line 621, in upgrade_firmware
58057693-    port = myzigate.connection._port
58057730-AttributeError: 'NoneType' object has no attribute '_port'
58057789-2020-02-23 16:15:51 DEBUG (SyncWorker_8) [zigate] REQUEST : 0x0100 b'\x02\x92\xf0\x01\x01\x00\x06\x00\x00\x00\x00\x01\x00\x00'
doudz commented 4 years ago

ok I see the problem. calling stop remove port informations, I have to fix that

doudz commented 4 years ago

Fixed