Skip to content

Commit

Permalink
Fix configflow myskoda (#32)
Browse files Browse the repository at this point in the history
* Fix ConfigFlow, use new MySkoda class

Fixes #31

* Bump to 1.4.1 with myskoda 0.6.1
  • Loading branch information
dvx76 authored Sep 25, 2024
1 parent be64ec4 commit 4ea03f7
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
12 changes: 6 additions & 6 deletions custom_components/myskoda/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,23 @@
from typing import Any

import voluptuous as vol

from homeassistant.config_entries import (
ConfigEntry,
ConfigFlow as BaseConfigFlow,
ConfigFlowResult,
OptionsFlow,
callback,
)
from homeassistant.config_entries import ConfigFlow as BaseConfigFlow
from homeassistant.core import HomeAssistant
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.schema_config_entry_flow import (
SchemaFlowFormStep,
SchemaOptionsFlowHandler,
)

from myskoda import RestApi
from homeassistant.util.ssl import get_default_context
from myskoda import MySkoda

from .const import DOMAIN

Expand All @@ -45,10 +46,9 @@

async def validate_input(hass: HomeAssistant, data: dict[str, Any]) -> None:
"""Check that the inputs are valid."""
hub = RestApi(async_get_clientsession(hass))
hub = MySkoda(async_get_clientsession(hass), get_default_context())

if not await hub.authenticate(data["email"], data["password"]):
raise InvalidAuth
await hub.connect(data["email"], data["password"])


class ConfigFlow(BaseConfigFlow, domain=DOMAIN):
Expand Down
4 changes: 2 additions & 2 deletions custom_components/myskoda/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/skodaconnect/homeassistant-myskoda/issues",
"loggers": ["custom_components.myskoda", "myskoda"],
"requirements": ["myskoda==0.6.0"],
"version": "1.4.0"
"requirements": ["myskoda==0.6.1"],
"version": "1.4.1"
}
28 changes: 14 additions & 14 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ pyjwt = "^2.9.0"
pyyaml = "^6.0.2"
asyncio = "^3.4.3"
voluptuous = "^0.15.2"
myskoda = "^0.6.0"
myskoda = "^0.6.1"


[tool.poetry.group.dev.dependencies]
Expand All @@ -27,4 +27,4 @@ requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.pyright]
reportIncompatibleVariableOverride = "none"
reportIncompatibleVariableOverride = "none"

0 comments on commit 4ea03f7

Please sign in to comment.