mirror of https://github.com/simbaja/ha_gehome.git
- removed references to _hass in update coordinator
- removed hass attribute in ge_entity - version bump
This commit is contained in:
parent
264c431ef9
commit
1d1ff7c990
|
@ -10,7 +10,6 @@ class GeEntity:
|
|||
|
||||
def __init__(self, api: ApplianceApi):
|
||||
self._api = api
|
||||
self.hass = None
|
||||
|
||||
@property
|
||||
def unique_id(self) -> str:
|
||||
|
|
|
@ -7,5 +7,5 @@
|
|||
"documentation": "https://github.com/simbaja/ha_gehome",
|
||||
"requirements": ["gehomesdk==0.5.23","magicattr==0.1.6","slixmpp==1.8.3"],
|
||||
"codeowners": ["@simbaja"],
|
||||
"version": "0.6.8"
|
||||
"version": "0.6.9"
|
||||
}
|
||||
|
|
|
@ -55,7 +55,8 @@ class GeHomeUpdateCoordinator(DataUpdateCoordinator):
|
|||
|
||||
def __init__(self, hass: HomeAssistant, config_entry: ConfigEntry) -> None:
|
||||
"""Set up the GeHomeUpdateCoordinator class."""
|
||||
self._hass = hass
|
||||
super().__init__(hass, _LOGGER, name=DOMAIN)
|
||||
|
||||
self._config_entry = config_entry
|
||||
self._username = config_entry.data[CONF_USERNAME]
|
||||
self._password = config_entry.data[CONF_PASSWORD]
|
||||
|
@ -64,8 +65,6 @@ class GeHomeUpdateCoordinator(DataUpdateCoordinator):
|
|||
|
||||
self._reset_initialization()
|
||||
|
||||
super().__init__(hass, _LOGGER, name=DOMAIN)
|
||||
|
||||
def _reset_initialization(self):
|
||||
self.client = None # type: Optional[GeWebsocketClient]
|
||||
|
||||
|
@ -161,8 +160,7 @@ class GeHomeUpdateCoordinator(DataUpdateCoordinator):
|
|||
finally:
|
||||
self._reset_initialization()
|
||||
|
||||
loop = self._hass.loop
|
||||
self.client = self.create_ge_client(event_loop=loop)
|
||||
self.client = self.create_ge_client(event_loop=self.hass.loop)
|
||||
return self.client
|
||||
|
||||
async def async_setup(self):
|
||||
|
@ -201,9 +199,9 @@ class GeHomeUpdateCoordinator(DataUpdateCoordinator):
|
|||
async def async_begin_session(self):
|
||||
"""Begins the ge_home session."""
|
||||
_LOGGER.debug("Beginning session")
|
||||
session = self._hass.helpers.aiohttp_client.async_get_clientsession()
|
||||
session = self.hass.helpers.aiohttp_client.async_get_clientsession()
|
||||
await self.client.async_get_credentials(session)
|
||||
fut = asyncio.ensure_future(self.client.async_run_client(), loop=self._hass.loop)
|
||||
fut = asyncio.ensure_future(self.client.async_run_client(), loop=self.hass.loop)
|
||||
_LOGGER.debug("Client running")
|
||||
return fut
|
||||
|
||||
|
@ -263,7 +261,7 @@ class GeHomeUpdateCoordinator(DataUpdateCoordinator):
|
|||
_LOGGER.info("ge_home shutting down")
|
||||
if self.client:
|
||||
self.client.clear_event_handlers()
|
||||
self._hass.loop.create_task(self.client.disconnect())
|
||||
self.hass.loop.create_task(self.client.disconnect())
|
||||
|
||||
async def on_device_update(self, data: Tuple[GeAppliance, Dict[ErdCodeType, Any]]):
|
||||
"""Let HA know there's new state."""
|
||||
|
|
Loading…
Reference in New Issue