Skip to content

Commit

Permalink
Handle entity unload (#337)
Browse files Browse the repository at this point in the history
* hande entity unload. fixes #332 

Co-authored-by: Joshua Mulliken <[email protected]>
  • Loading branch information
brg468 and Joshua Mulliken authored Feb 4, 2022
1 parent bfa3c68 commit 6772130
Show file tree
Hide file tree
Showing 7 changed files with 186 additions and 211 deletions.
2 changes: 1 addition & 1 deletion custom_components/wyzeapi/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,4 +321,4 @@ async def async_added_to_hass(self) -> None:
return await super().async_added_to_hass()

async def async_will_remove_from_hass(self) -> None:
self._thermostat_service.unregister_updater()
self._thermostat_service.unregister_updater(self._thermostat)
2 changes: 1 addition & 1 deletion custom_components/wyzeapi/light.py
Original file line number Diff line number Diff line change
Expand Up @@ -255,4 +255,4 @@ async def async_added_to_hass(self) -> None:
return await super().async_added_to_hass()

async def async_will_remove_from_hass(self) -> None:
self._bulb_service.unregister_updater()
self._bulb_service.unregister_updater(self._bulb)
2 changes: 1 addition & 1 deletion custom_components/wyzeapi/lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,4 @@ async def async_added_to_hass(self) -> None:
return await super().async_added_to_hass()

async def async_will_remove_from_hass(self) -> None:
self._lock_service.unregister_updater()
self._lock_service.unregister_updater(self._lock)
4 changes: 2 additions & 2 deletions custom_components/wyzeapi/manifest.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"domain": "wyzeapi",
"version": "0.1.5-alpha.0",
"version": "0.1.5-alpha.1",
"name": "Wyze",
"config_flow": true,
"iot_class": "cloud_polling",
"documentation": "https://github.com/JoshuaMulliken/ha-wyzeapi#readme",
"issue_tracker": "https://github.com/JoshuaMulliken/ha-wyzeapi/issues",
"requirements": [
"wyzeapy==0.5.6a0"
"wyzeapy==0.5.6a1"
],
"codeowners": [
"@JoshuaMulliken"
Expand Down
2 changes: 1 addition & 1 deletion custom_components/wyzeapi/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,4 +281,4 @@ async def async_added_to_hass(self) -> None:
return await super().async_added_to_hass()

async def async_will_remove_from_hass(self) -> None:
self._service.unregister_updater()
self._service.unregister_updater(self._device)
381 changes: 178 additions & 203 deletions poetry.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

[tool.poetry]
name = "ha-wyzeapi"
version = "0.1.5-alpha.0"
version = "0.1.5-alpha.1"
description = "A Home Assistant integration for Wyze devices"
authors = ["Joshua Mulliken <[email protected]>"]
license = "Apache-2.0"

[tool.poetry.dependencies]
python = "^3.8"
homeassistant = "^2021.11.5"
wyzeapy = "0.5.6a0"
wyzeapy = "0.5.6a1"

[tool.poetry.dev-dependencies]

Expand Down

0 comments on commit 6772130

Please sign in to comment.