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

SOC Modul über SkodaConnect #762

Merged
merged 10 commits into from Apr 4, 2023
Merged

Conversation

vuffiraa72
Copy link
Contributor

Das SOC Modul nutzt die Bibliothek Skoda Connect.
Getestet habe ich mir meinem Skoda Enyaq, aber auch andere BEVs des Hersteller werden durch die Bibliothek unterstützt.

Im Dataclass_util wurde das Handling für Optional[dict] ergänzt, um in der SOC Modulkonfiguration optionale dict-Parameter zu ermöglichen.

packages/modules/vehicles/skodaconnect/soc.py Outdated Show resolved Hide resolved
packages/modules/vehicles/skodaconnect/config.py Outdated Show resolved Hide resolved
packages/modules/vehicles/skodaconnect/api.py Outdated Show resolved Hide resolved
vuffiraa72 and others added 4 commits February 9, 2023 09:12
Co-authored-by: LKuemmel <76958050+LKuemmel@users.noreply.github.com>
Co-authored-by: LKuemmel <76958050+LKuemmel@users.noreply.github.com>
packages/modules/vehicles/skodaconnect/config.py Outdated Show resolved Hide resolved
Comment on lines +48 to +54
def _is_optional_of_dict(requested_type):
# Optional[dict] is an alias for Union[dict, None]
if typing.get_origin(requested_type) == Union:
args = typing.get_args(requested_type)
if len(args) == 2:
return issubclass(args[0], dict) and issubclass(args[1], type(None))
return False
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nach der Anmerkung von Lutz kann das nun weg oder?

Suggested change
def _is_optional_of_dict(requested_type):
# Optional[dict] is an alias for Union[dict, None]
if typing.get_origin(requested_type) == Union:
args = typing.get_args(requested_type)
if len(args) == 2:
return issubclass(args[0], dict) and issubclass(args[1], type(None))
return False

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nein, hier ist etwas anderes gemeint. In der Konfiguration werden Refresh-Tokens gespeichert, soweit sie verfügbar ist. Damit diese Tokens wieder wieder gepasst werden können, ist diese Anpassung nötig.
Ich habe mal zum Verständnis einen Test hinzugefügt.

@LKuemmel LKuemmel merged commit 84b3be7 into openWB:master Apr 4, 2023
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

Successfully merging this pull request may close these issues.

None yet

3 participants