diff --git a/README.md b/README.md index 527e18b..b64d49e 100644 --- a/README.md +++ b/README.md @@ -12,13 +12,7 @@ manually include this repository in HACS: 1. If you haven't already installed HACS, follow [their instructions](https://hacs.xyz/docs/setup/prerequisites). 2. Navigate to HACS. 3. Choose "Integrations" -4. Add this repository to your configuration. - 1. Click the three dots in the upper right-hand corner. - 2. Select "Custom repositories" - 3. Enter `mbillow/ha-chargepoint` into the repository box. - 4. Select the "Integration" type. - 5. Click `Add`. -5. Install the integration like you would [any other HACS addon](https://hacs.xyz/docs/navigation/overview). +4. Install the integration like you would [any other HACS addon](https://hacs.xyz/docs/navigation/overview). ## Usage diff --git a/custom_components/chargepoint/__init__.py b/custom_components/chargepoint/__init__.py index eb589aa..0c23b6c 100755 --- a/custom_components/chargepoint/__init__.py +++ b/custom_components/chargepoint/__init__.py @@ -101,14 +101,19 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry): ) username = entry.data[CONF_USERNAME] password = entry.data[CONF_PASSWORD] - original_session_token = entry.data[CONF_ACCESS_TOKEN] - session_token = retrieve_session_token(hass, entry) or original_session_token + current_token = entry.data[CONF_ACCESS_TOKEN] + token_from_disk = await hass.async_add_executor_job( + retrieve_session_token, hass, entry + ) + session_token = token_from_disk or current_token try: client: ChargePoint = await hass.async_add_executor_job( ChargePoint, username, password, session_token ) - persist_session_token(hass, entry, client.session_token) + await hass.async_add_executor_job( + persist_session_token, hass, entry, client.session_token + ) except ChargePointLoginError as exc: _LOGGER.error("Failed to authenticate to ChargePoint") raise ConfigEntryAuthFailed from exc diff --git a/custom_components/chargepoint/manifest.json b/custom_components/chargepoint/manifest.json index e96c07f..f1a2c1a 100755 --- a/custom_components/chargepoint/manifest.json +++ b/custom_components/chargepoint/manifest.json @@ -9,5 +9,5 @@ "requirements": [ "python-chargepoint==1.9.2" ], - "version": "0.7.0" + "version": "0.8.0" }