Skip to content

Commit

Permalink
create JSON directly
Browse files Browse the repository at this point in the history
  • Loading branch information
vuffiraa72 committed Feb 16, 2023
1 parent 9d5311e commit ab0f9c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
3 changes: 2 additions & 1 deletion packages/modules/vehicles/skodaconnect/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import aiohttp
import asyncio
import logging
from dataclass_utils import asdict
from helpermodules.pub import Pub
from modules.vehicles.skodaconnect.config import SkodaConnect, SkodaConnectConfiguration
from skodaconnect import Connection
Expand Down Expand Up @@ -79,7 +80,7 @@ def _persist_refresh_tokens(self, tokens: dict) -> None:
self.password,
self.vin,
tokens))
self._publish_refresh_tokens(conf.as_dict())
self._publish_refresh_tokens(asdict(conf))

def _publish_refresh_tokens(self, config={}) -> None:
try:
Expand Down
5 changes: 0 additions & 5 deletions packages/modules/vehicles/skodaconnect/config.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from typing import Optional
from dataclass_utils import asdict


class SkodaConnectConfiguration:
Expand All @@ -23,7 +22,3 @@ def __init__(self,
self.name = name
self.type = type
self.configuration = configuration or SkodaConnectConfiguration()

def as_dict(self) -> dict:
confDict = asdict(self)
return confDict

0 comments on commit ab0f9c4

Please sign in to comment.