Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Phyton Error #34

Closed
hhoefling opened this issue Aug 31, 2021 · 2 comments
Closed

Phyton Error #34

hhoefling opened this issue Aug 31, 2021 · 2 comments

Comments

@hhoefling
Copy link
Contributor

Hello i try to use these code with Phyton3.9

at "Departure timer 1 departure1 "
-->
Traceback (most recent call last):
File "/var/www/html/callskoda.py", line 240, in
loop.run_until_complete(main())
File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/var/www/html/callskoda.py", line 204, in main
print(f'{instrument.full_name} {instrument.attr} - ({val})\tstr_state: ({instrument.str_state})\tattributes: {instrument.attributes}')
File "/var/www/html/skodaconnect/dashboard.py", line 295, in str_state
str(datetime.strptime(ts,'%Y-%m-%dT%H:%M:%SZ').astimezone(tz=None)) if ts else None,
TypeError: strptime() argument 1 must be str, not datetime.datetime

any Idee?
with python Version are used?

lg
Heinz

@Farfar
Copy link
Collaborator

Farfar commented Aug 31, 2021

Hello i try to use these code with Phyton3.9

at "Departure timer 1 departure1 "
-->
Traceback (most recent call last):
File "/var/www/html/callskoda.py", line 240, in
loop.run_until_complete(main())
File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/var/www/html/callskoda.py", line 204, in main
print(f'{instrument.full_name} {instrument.attr} - ({val})\tstr_state: ({instrument.str_state})\tattributes: {instrument.attributes}')
File "/var/www/html/skodaconnect/dashboard.py", line 295, in str_state
str(datetime.strptime(ts,'%Y-%m-%dT%H:%M:%SZ').astimezone(tz=None)) if ts else None,
TypeError: strptime() argument 1 must be str, not datetime.datetime

any Idee?
with python Version are used?

lg
Heinz

Hi,

Should work with versions 3.7-3.9 but I haven't tested 3.9 myself.
Latest commit contain a fix for this, #30

@Farfar
Copy link
Collaborator

Farfar commented Sep 2, 2021

Fixed in commit 4036371, will be included in release 1.1.0 when released.

@Farfar Farfar closed this as completed Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants