Skip to content

Commit 2a02a04

Browse files
authored
Merge pull request #865 from plugwise/pw_config_entry
Remove double use of entry, bump plugwise to v.1.7.4
2 parents d5d17db + dbe40f4 commit 2a02a04

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

custom_components/plugwise/coordinator.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -126,24 +126,20 @@ async def _async_update_data(self) -> dict[str, GwEntityData]:
126126
) from err
127127

128128
LOGGER.debug(f"{self.api.smile_name} data: %s", data)
129-
await self._async_add_remove_devices(data, self.config_entry)
129+
await self._async_add_remove_devices(data)
130130
return data
131131

132-
async def _async_add_remove_devices(
133-
self, data: dict[str, GwEntityData], entry: ConfigEntry
134-
) -> None:
132+
async def _async_add_remove_devices(self, data: dict[str, GwEntityData]) -> None:
135133
"""Add new Plugwise devices, remove non-existing devices."""
136134
# Check for new or removed devices
137135
self.new_devices = set(data) - self._current_devices
138136
removed_devices = self._current_devices - set(data)
139137
self._current_devices = set(data)
140138

141139
if removed_devices:
142-
await self._async_remove_devices(data, entry)
140+
await self._async_remove_devices(data)
143141

144-
async def _async_remove_devices(
145-
self, data: dict[str, GwEntityData], entry: ConfigEntry
146-
) -> None:
142+
async def _async_remove_devices(self, data: dict[str, GwEntityData]) -> None:
147143
"""Clean registries when removed devices found."""
148144
device_reg = dr.async_get(self.hass)
149145
device_list = dr.async_entries_for_config_entry(
@@ -164,7 +160,7 @@ async def _async_remove_devices(
164160
and identifier[1] not in data
165161
):
166162
device_reg.async_update_device(
167-
device_entry.id, remove_config_entry_id=entry.entry_id
163+
device_entry.id, remove_config_entry_id=self.config_entry.entry_id
168164
)
169165
LOGGER.debug(
170166
"Removed %s device/zone %s %s from device_registry",

custom_components/plugwise/manifest.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"integration_type": "hub",
88
"iot_class": "local_polling",
99
"loggers": ["plugwise"],
10-
"requirements": ["plugwise==1.7.3"],
11-
"version": "0.57.2",
10+
"requirements": ["plugwise==1.7.4"],
11+
"version": "0.57.3",
1212
"zeroconf": ["_plugwise._tcp.local."]
1313
}

pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version = "0.57.1"
44
description = "Plugwise beta custom-component"
55
readme = "README.md"
66
requires-python = ">=3.12"
7-
license = {file = "LICENSE"}
7+
license = "MIT"
88
keywords = ["Plugwise", "Adam", "Anna", "P1", "Stretch", "Smile"]
99
authors = [
1010
{name = "@bouwew"},
@@ -22,7 +22,6 @@ classifiers = [
2222
"Development Status :: 4 - Beta",
2323
"Programming Language :: Python",
2424
"Intended Audience :: Testers",
25-
"License :: OSI Approved :: MIT License",
2625
"Operating System :: OS Independent",
2726
"Programming Language :: Python :: 3.13",
2827
"Topic :: Home Automation",]

0 commit comments

Comments
 (0)