updated atom
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -58,6 +58,7 @@ async def validate_input(hass: HomeAssistant, user_input: dict[str, Any]) -> Tok
|
||||
api = VehicleManager.get_implementation_by_region_brand(
|
||||
user_input[CONF_REGION],
|
||||
user_input[CONF_BRAND],
|
||||
language=hass.config.language,
|
||||
)
|
||||
token: Token = await hass.async_add_executor_job(
|
||||
api.login, user_input[CONF_USERNAME], user_input[CONF_PASSWORD]
|
||||
@@ -134,6 +135,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
"""Handle a config flow for Hyundai / Kia Connect."""
|
||||
|
||||
VERSION = 2
|
||||
reauth_entry: ConfigEntry | None = None
|
||||
|
||||
@staticmethod
|
||||
@callback
|
||||
@@ -172,6 +174,23 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
||||
step_id="user", data_schema=STEP_USER_DATA_SCHEMA, errors=errors
|
||||
)
|
||||
|
||||
async def async_step_reauth(self, user_input=None):
|
||||
"""Perform reauth upon an API authentication error."""
|
||||
self.reauth_entry = self.hass.config_entries.async_get_entry(
|
||||
self.context["entry_id"]
|
||||
)
|
||||
return await self.async_step_reauth_confirm()
|
||||
|
||||
async def async_step_reauth_confirm(self, user_input=None):
|
||||
"""Dialog that informs the user that reauth is required."""
|
||||
if user_input is None:
|
||||
return self.async_show_form(
|
||||
step_id="reauth_confirm",
|
||||
data_schema=vol.Schema({}),
|
||||
)
|
||||
self._reauth = True
|
||||
return await self.async_step_user()
|
||||
|
||||
|
||||
class InvalidAuth(HomeAssistantError):
|
||||
"""Error to indicate there is invalid auth."""
|
||||
|
||||
@@ -60,6 +60,7 @@ class HyundaiKiaConnectDataUpdateCoordinator(DataUpdateCoordinator):
|
||||
geocode_api_use_email=config_entry.options.get(
|
||||
CONF_USE_EMAIL_WITH_GEOCODE_API, DEFAULT_USE_EMAIL_WITH_GEOCODE_API
|
||||
),
|
||||
language=hass.config.language,
|
||||
)
|
||||
self.scan_interval: int = (
|
||||
config_entry.options.get(CONF_SCAN_INTERVAL, DEFAULT_SCAN_INTERVAL) * 60
|
||||
@@ -202,7 +203,7 @@ class HyundaiKiaConnectDataUpdateCoordinator(DataUpdateCoordinator):
|
||||
async def async_start_charge(self, vehicle_id: str):
|
||||
await self.async_check_and_refresh_token()
|
||||
await self.hass.async_add_executor_job(
|
||||
self.vehicle_manager.stop_charge, vehicle_id
|
||||
self.vehicle_manager.start_charge, vehicle_id
|
||||
)
|
||||
await self.async_request_refresh()
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
"documentation": "https://github.com/fuatakgun/kia_uvo",
|
||||
"issue_tracker": "https://github.com/fuatakgun/kia_uvo/issues",
|
||||
"codeowners": ["@fuatakgun"],
|
||||
"requirements": ["hyundai_kia_connect_api==1.45.6"],
|
||||
"version": "2.0.50",
|
||||
"requirements": ["hyundai_kia_connect_api==1.50.3"],
|
||||
"version": "2.2.1",
|
||||
"config_flow": true,
|
||||
"iot_class": "cloud_polling",
|
||||
"integration_type": "hub"
|
||||
|
||||
@@ -185,6 +185,11 @@ SENSOR_DESCRIPTIONS: Final[tuple[SensorEntityDescription, ...]] = (
|
||||
name="Geocoded Location",
|
||||
icon="mdi:map",
|
||||
),
|
||||
SensorEntityDescription(
|
||||
key="dtc_count",
|
||||
name="DTC Count",
|
||||
icon="mdi:alert-circle",
|
||||
),
|
||||
)
|
||||
|
||||
|
||||
@@ -244,6 +249,8 @@ class HyundaiKiaConnectSensor(SensorEntity, HyundaiKiaConnectEntity):
|
||||
def state_attributes(self):
|
||||
if self._description.key == "_geocode_name":
|
||||
return {"address": getattr(self.vehicle, "_geocode_address")}
|
||||
elif self._description.key == "dtc_count":
|
||||
return {"DTC Text": getattr(self.vehicle, "dtc_descriptions")}
|
||||
|
||||
|
||||
class VehicleEntity(SensorEntity, HyundaiKiaConnectEntity):
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
"brand": "[%key:component::hyundai_kia_connect::config::step::user::data::brand%]",
|
||||
"pin": "[%key:common::config_flow::data::pin%]"
|
||||
}
|
||||
},
|
||||
"reauth_confirm": {
|
||||
"title": "[%key:common::config_flow::title::reauth%]",
|
||||
"description": "The Hyundai / Kia Connect integration needs to re-authenticate your account"
|
||||
}
|
||||
},
|
||||
"error": {
|
||||
@@ -16,7 +20,8 @@
|
||||
"unknown": "[%key:common::config_flow::error::unknown%]"
|
||||
},
|
||||
"abort": {
|
||||
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]"
|
||||
"already_configured": "[%key:common::config_flow::abort::already_configured_device%]",
|
||||
"reauth_successful": "[%key:common::config_flow::abort::reauth_successful%]"
|
||||
}
|
||||
},
|
||||
"options": {
|
||||
|
||||
Reference in New Issue
Block a user