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

Changes in Bosch API #113

Merged
merged 2 commits into from
Oct 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions pyIndego/indego_async_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,8 +446,8 @@ async def get_user(self):
async def login(self, attempts: int = 0):
"""Login to the api and store the context."""
response = await self._request(
method=Methods.POST,
path="authenticate",
method=Methods.GET,
path="authenticate/check",
data=DEFAULT_BODY,
headers=DEFAULT_HEADER,
auth=BasicAuth(self._username, self._password),
Expand Down Expand Up @@ -524,7 +524,7 @@ async def _request( # noqa: C901
)
return None
if status == 401:
if path == "authenticate":
if path == "authenticate/check":
_LOGGER.info(
"401: Unauthorized, credentials are wrong, won't retry"
)
Expand Down
4 changes: 4 additions & 0 deletions pyIndego/states.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ class GenericData:
model_description: str = None
model_voltage: ModelVoltage = field(default_factory=ModelVoltage)
mowing_mode_description: str = None
#renew_date: str = None
renew_date: datetime = None

def __post_init__(self):
"""Set model description, voltage, mode description."""
Expand All @@ -179,6 +181,7 @@ def __post_init__(self):
self.mowing_mode_description = MOWING_MODE_DESCRIPTION.get(
self.alm_mode, DEFAULT_LOOKUP_VALUE
)
self.renew_date = convert_bosch_datetime(self.renew_date)


@dataclass
Expand Down Expand Up @@ -317,6 +320,7 @@ class State:
svg_yPos: int = None
config_change: bool = None
mow_trig: bool = None
enabled: bool = None


@dataclass
Expand Down