Add evohome water_heater service calls, bump client to 0.3.15 (#50803)

This commit is contained in:
David Bonnes 2021-05-19 10:41:20 +01:00 committed by GitHub
parent b7fc537cd5
commit 28e9b9e01d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 7 deletions

View file

@ -180,7 +180,7 @@ async def async_setup(hass: HomeAssistant, config: ConfigType) -> bool:
async def load_auth_tokens(store) -> tuple[dict, dict | None]:
app_storage = await store.async_load()
tokens = dict(app_storage if app_storage else {})
tokens = dict(app_storage or {})
if tokens.pop(CONF_USERNAME, None) != config[DOMAIN][CONF_USERNAME]:
# any tokens won't be valid, and store might be be corrupt
@ -406,10 +406,12 @@ class EvoBroker:
# evohomeasync2 uses naive/local datetimes
access_token_expires = _dt_local_to_aware(self.client.access_token_expires)
app_storage = {CONF_USERNAME: self.client.username}
app_storage[REFRESH_TOKEN] = self.client.refresh_token
app_storage[ACCESS_TOKEN] = self.client.access_token
app_storage[ACCESS_TOKEN_EXPIRES] = access_token_expires.isoformat()
app_storage = {
CONF_USERNAME: self.client.username,
REFRESH_TOKEN: self.client.refresh_token,
ACCESS_TOKEN: self.client.access_token,
ACCESS_TOKEN_EXPIRES: access_token_expires.isoformat(),
}
if self.client_v1 and self.client_v1.user_data:
app_storage[USER_DATA] = {

View file

@ -2,7 +2,7 @@
"domain": "evohome",
"name": "Honeywell Total Connect Comfort (Europe)",
"documentation": "https://www.home-assistant.io/integrations/evohome",
"requirements": ["evohome-async==0.3.8"],
"requirements": ["evohome-async==0.3.15"],
"codeowners": ["@zxdavb"],
"iot_class": "cloud_polling"
}

View file

@ -112,6 +112,14 @@ class EvoDHW(EvoChild, WaterHeaterEntity):
"""Turn away mode off."""
await self._evo_broker.call_client_api(self._evo_device.set_dhw_auto())
async def async_turn_on(self):
"""Turn on."""
await self._evo_broker.call_client_api(self._evo_device.set_dhw_on())
async def async_turn_off(self):
"""Turn off."""
await self._evo_broker.call_client_api(self._evo_device.set_dhw_off())
async def async_update(self) -> None:
"""Get the latest state data for a DHW controller."""
await super().async_update()

View file

@ -581,7 +581,7 @@ eternalegypt==0.0.12
# evdev==1.4.0
# homeassistant.components.evohome
evohome-async==0.3.8
evohome-async==0.3.15
# homeassistant.components.faa_delays
faadelays==0.0.7