JanJaapKo / domoticz-GoodWeSEMS

Domoticz GoodWe Solar Inverter plugin (SEMS API)
http://www.domoticz.com/forum/viewtopic.php?f=65&t=28983
MIT License
6 stars 4 forks source link

Entering wrong pasword crashes plugin #7

Closed JanJaapKo closed 2 years ago

JanJaapKo commented 2 years ago

Describe the bug When a wrong pass word is entered the plugin crashes 2022-04-12 12:43:02.271 Zonnepanelen: onStop - Plugin is stopping. 2022-04-12 12:43:02.672 Zonnepanelen: Worker thread started. 2022-04-12 12:43:02.271 Status: Zonnepanelen: Stop directive received. 2022-04-12 12:43:02.579 Status: Zonnepanelen: Exiting work loop. 2022-04-12 12:43:02.671 Status: Zonnepanelen: Stopping threads. 2022-04-12 12:43:02.671 Status: Zonnepanelen: Stopped. 2022-04-12 12:43:02.672 Status: Zonnepanelen: Entering work loop. 2022-04-12 12:43:02.672 Status: Zonnepanelen: Started. 2022-04-12 12:43:03.537 Status: Zonnepanelen: Initialized version 2.0.7, author 'Jan-Jaap Kostelijk' 2022-04-12 12:43:04.977 Zonnepanelen: Failed to call GoodWe API (no valid token), will be refreshed 2022-04-12 12:43:10.110 Error: Zonnepanelen: RequestException: HTTPSConnectionPool(host='eu.semsportal.com', port=443): Read timed out. (read timeout=5) 2022-04-12 12:43:11.285 Zonnepanelen: Failed to call GoodWe API (no valid token), will be refreshed 2022-04-12 12:43:16.421 Error: Zonnepanelen: RequestException: HTTPSConnectionPool(host='eu.semsportal.com', port=443): Read timed out. (read timeout=5) 2022-04-12 12:43:24.615 Zonnepanelen: Failed to call GoodWe API (no valid token), will be refreshed 2022-04-12 12:43:27.521 Error: Zonnepanelen: Call to function 'onStart' failed, exception details: 2022-04-12 12:43:27.525 Error: Zonnepanelen: Traceback (most recent call last): 2022-04-12 12:43:27.525 Error: Zonnepanelen: File "/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py", line 441, in onStart 2022-04-12 12:43:27.525 Error: Zonnepanelen: _plugin.onStart() 2022-04-12 12:43:27.525 Error: Zonnepanelen: File "/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py", line 208, in onStart 2022-04-12 12:43:27.525 Error: Zonnepanelen: self.startDeviceUpdateV2() 2022-04-12 12:43:27.525 Error: Zonnepanelen: File "/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/plugin.py", line 125, in startDeviceUpdateV2 2022-04-12 12:43:27.525 Error: Zonnepanelen: DeviceData = self.goodWeAccount.stationDataRequestV2(Parameters["Mode1"]) 2022-04-12 12:43:27.525 Error: Zonnepanelen: File "/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py", line 399, in stationDataRequestV2 2022-04-12 12:43:27.525 Error: Zonnepanelen: self.tokenRequest() 2022-04-12 12:43:27.525 Error: Zonnepanelen: File "/home/pi/domoticz/plugins/domoticz-GoodWeSEMS/GoodWe.py", line 333, in tokenRequest 2022-04-12 12:43:27.525 Error: Zonnepanelen: raise Exception(data['msg']) 2022-04-12 12:43:27.525 Error: Zonnepanelen: NameError: name 'data' is not defined

Expected behavior clear error stating 'wrong password/username'.

Domoticz environment (please complete the following information):

Additional context Add any other context about the problem here.