stegm / pykoplenti

Python REST client API for Kostal Plenticore Inverters
Apache License 2.0
16 stars 5 forks source link

Python 3.9 still supported? #17

Open spaceone opened 1 month ago

spaceone commented 1 month ago

The README states that Python >= 3.7 is supported. When trying to use this project with Python 3.9 the following happens:

    from pykoplenti import ExtendedApiClient                                                                           
  File "/home/pi/.local/lib/python3.9/site-packages/pykoplenti/__init__.py", line 1, in <module>                       
    from .api import (                                                                                                 
  File "/home/pi/.local/lib/python3.9/site-packages/pykoplenti/api.py", line 19, in <module>
    from .model import (                                                                                               
  File "/home/pi/.local/lib/python3.9/site-packages/pykoplenti/model.py", line 77, in <module>                                                                                                                                                 
    class SettingsData(BaseModel):                                                                                                                                                                                                             
  File "/home/pi/.local/lib/python3.9/site-packages/pykoplenti/model.py", line 80, in SettingsData                                                                                                                                             
    min: str | None                                                                                                                                                                                                                            
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType' 

resolving this is followed by:

    from pykoplenti import ExtendedApiClient
  File "/home/pi/.local/lib/python3.9/site-packages/pykoplenti/__init__.py", line 1, in <module>
    from .api import (
  File "/home/pi/.local/lib/python3.9/site-packages/pykoplenti/api.py", line 90, in <module>
    class ApiClient(contextlib.AbstractAsyncContextManager):
  File "/home/pi/.local/lib/python3.9/site-packages/pykoplenti/api.py", line 417, in ApiClient
    async def get_events(self, max_count=10, lang=None) -> Iterable[EventData]:
TypeError: 'staticmethod' object is not callable
spaceone commented 1 month ago

setup.cfg also mentions:

    Programming Language :: Python :: 3
    Programming Language :: Python :: 3.7
    Programming Language :: Python :: 3.8
stegm commented 1 month ago

I prepared a pull request. Feel free to test it out.