Bump whirlpool-sixth-sense to 0.18.1 (#85521)

* Bump whirlpool to 0.18.1
Add HASS AIOsession
Add unregister to remove_from_hass

* remove session from WhirlpoolData class
This commit is contained in:
mkmer 2023-01-10 04:41:35 -05:00 committed by GitHub
parent bba9ad3243
commit b86c58b0ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 35 additions and 17 deletions

View file

@ -16,6 +16,7 @@ from homeassistant.components.sensor import (
)
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.entity import DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.typing import StateType
@ -148,6 +149,7 @@ async def async_setup_entry(
whirlpool_data.backend_selector,
whirlpool_data.auth,
appliance["SAID"],
async_get_clientsession(hass),
)
await _wd.connect()
@ -211,7 +213,7 @@ class WasherDryerClass(SensorEntity):
async def async_will_remove_from_hass(self) -> None:
"""Close Whrilpool Appliance sockets before removing."""
await self._wd.disconnect()
self._wd.unregister_attr_callback(self.async_write_ha_state)
@property
def available(self) -> bool: