This script worked fine for a few days and today it fails with the following:
Traceback (most recent call last):
File "e:\Github\sunsynk-api-client-main\get-inverter.py", line 62, in <module>
run()
File "e:\Github\sunsynk-api-client-main\get-inverter.py", line 59, in run
asyncio.run(main())
File "C:\Users\s\AppData\Local\Programs\Python\Python39\lib\asyncio\runners.py", line 44, in run
return loop.run_until_complete(main)
File "C:\Users\s\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 642, in run_until_complete
return future.result()
File "e:\Github\sunsynk-api-client-main\get-inverter.py", line 25, in main
await sunsynk_client.get_inverter_realtime_output(inverter.sn)
File "e:\Github\sunsynk-api-client-main\sunsynk\client.py", line 62, in get_inverter_realtime_output
return Output(body['data'])
File "e:\Github\sunsynk-api-client-main\sunsynk\output.py", line 7, in __init__
self.vip = [Vip(vip_data) for vip_data in data['vip']]
File "e:\Github\sunsynk-api-client-main\sunsynk\output.py", line 7, in <listcomp>
self.vip = [Vip(vip_data) for vip_data in data['vip']]
File "e:\Github\sunsynk-api-client-main\sunsynk\vip.py", line 6, in __init__
self.voltage = float(data['volt'])
TypeError: float() argument must be a string or a number, not 'NoneType'
Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000002048E668F70>
Traceback (most recent call last):
File "C:\Users\s\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 116, in __del__
self.close()
File "C:\Users\s\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 108, in close
self._loop.call_soon(self._call_connection_lost, None)
File "C:\Users\s\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 746, in call_soon
self._check_closed()
File "C:\Users\s\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 510, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed
The data in the sunsynk app is just fine and updating ok.
This script worked fine for a few days and today it fails with the following:
The data in the sunsynk app is just fine and updating ok.