Skip to content

ValueError: 9 is not a valid DataType / Event loop is closed #103

@philippabele

Description

@philippabele

First of all, I would to thank you for this great project to provide an easy to consume Python wrapper.

I tried to use it with my Somfy System by:

  • creating a new env python -m venv env and activate it
  • install the package pip install pyhoma
  • copy and paste the getting started example to a new script file start.py
  • entered my somfy credentials for username and password
  • starting it with python start.py

Unfortunately I recieved the following Error Messages

(env) c:\github\test-pyhoma>python start.py
ValueError: 9 is not a valid DataType
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "start.py", line 29, in
asyncio.run(main())
File "C:\Python38\lib\asyncio\runners.py", line 43, in run
return loop.run_until_complete(main)
File "C:\Python38\lib\asyncio\base_events.py", line 616, in run_until_complete
return future.result()
File "start.py", line 17, in main
devices = await client.get_devices()
File "c:\github\test-pyhoma\env\lib\site-packages\backoff_async.py", line 133, in retry
ret = await target(*args, **kwargs)
File "c:\github\test-pyhoma\env\lib\site-packages\pyhoma\client.py", line 117, in get_devices
devices = [Device(**d) for d in humps.decamelize(response)]
File "c:\github\test-pyhoma\env\lib\site-packages\pyhoma\client.py", line 117, in
devices = [Device(**d) for d in humps.decamelize(response)]
File "c:\github\test-pyhoma\env\lib\site-packages\pyhoma\models.py", line 64, in init
self.attributes = States(attributes) if attributes else None
File "c:\github\test-pyhoma\env\lib\site-packages\pyhoma\models.py", line 160, in init
self._states = [State(**state) for state in states]
File "c:\github\test-pyhoma\env\lib\site-packages\pyhoma\models.py", line 160, in
self._states = [State(**state) for state in states]
File "c:\github\test-pyhoma\env\lib\site-packages\pyhoma\models.py", line 155, in init
self.type = DataType(type)
File "C:\Python38\lib\enum.py", line 304, in call
return cls.new(cls, value)
File "C:\Python38\lib\enum.py", line 595, in new
raise exc
File "C:\Python38\lib\enum.py", line 579, in new
result = cls.missing(value)
File "C:\Python38\lib\enum.py", line 608, in missing
raise ValueError("%r is not a valid %s" % (value, cls.name))
ValueError: 9 is not a valid DataType
Exception ignored in: <function _ProactorBasePipeTransport.del at 0x000001D020474D30>
Traceback (most recent call last):
File "C:\Python38\lib\asyncio\proactor_events.py", line 116, in del
self.close()
File "C:\Python38\lib\asyncio\proactor_events.py", line 108, in close
self._loop.call_soon(self._call_connection_lost, None)
File "C:\Python38\lib\asyncio\base_events.py", line 719, in call_soon
self._check_closed()
File "C:\Python38\lib\asyncio\base_events.py", line 508, in _check_closed
raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

May someone has an idea, what is going wrong here?

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions