Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Versions from 0.40 and up

## v0.57.5

- Bump plugwise to [v1.7.7](https://github.com/plugwise/python-plugwise/releases/tag/v1.7.7) and adapt, small improvements

## v0.57.4

- Maintenance chores on CI
Expand Down
12 changes: 6 additions & 6 deletions custom_components/plugwise/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ async def async_setup_entry(hass: HomeAssistant, entry: PlugwiseConfigEntry) ->
config_entry_id=entry.entry_id,
identifiers={(DOMAIN, str(coordinator.api.gateway_id))},
manufacturer="Plugwise",
model=coordinator.api.smile_model,
model_id=coordinator.api.smile_model_id,
name=coordinator.api.smile_name,
sw_version=str(coordinator.api.smile_version),
model=coordinator.api.smile.model,
model_id=coordinator.api.smile.model_id,
name=coordinator.api.smile.name,
sw_version=str(coordinator.api.smile.version),
) # required for adding the entity-less P1 Gateway

async def delete_notification(
Expand All @@ -62,15 +62,15 @@ async def delete_notification(
"""Service: delete the Plugwise Notification."""
LOGGER.debug(
"Service delete PW Notification called for %s",
coordinator.api.smile_name,
coordinator.api.smile.name,
)
try:
await coordinator.api.delete_notification()
LOGGER.debug("PW Notification deleted")
except PlugwiseError:
LOGGER.debug(
"Failed to delete the Plugwise Notification for %s",
coordinator.api.smile_name,
coordinator.api.smile.name,
)

await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
Expand Down
4 changes: 2 additions & 2 deletions custom_components/plugwise/climate.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def _add_entities() -> None:
return

entities: list[PlugwiseClimateEntity] = []
gateway_name = coordinator.api.smile_name
gateway_name = coordinator.api.smile.name
for device_id in coordinator.new_devices:
device = coordinator.data[device_id]
if gateway_name == "Adam":
Expand Down Expand Up @@ -139,7 +139,7 @@ def __init__(
self._attr_supported_features = ClimateEntityFeature.TARGET_TEMPERATURE
if (
self.coordinator.api.cooling_present
and coordinator.api.smile_name != "Adam"
and coordinator.api.smile.name != "Adam"
):
self._attr_supported_features = (
ClimateEntityFeature.TARGET_TEMPERATURE_RANGE
Expand Down
10 changes: 5 additions & 5 deletions custom_components/plugwise/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,10 +245,10 @@ async def async_step_user(
api, errors = await verify_connection(self.hass, user_input)
if api:
await self.async_set_unique_id(
api.smile_hostname or api.gateway_id, raise_on_progress=False
api.smile.hostname or api.gateway_id, raise_on_progress=False
)
self._abort_if_unique_id_configured()
return self.async_create_entry(title=api.smile_name, data=user_input)
return self.async_create_entry(title=api.smile.name, data=user_input)

configure_input = self.discovery_info or user_input
return self.async_show_form(
Expand Down Expand Up @@ -278,7 +278,7 @@ async def async_step_reconfigure(
api, errors = await verify_connection(self.hass, full_input)
if api:
await self.async_set_unique_id(
api.smile_hostname or api.gateway_id, raise_on_progress=False
api.smile.hostname or api.gateway_id, raise_on_progress=False
)
self._abort_if_unique_id_mismatch(reason="not_the_same_smile")
return self.async_update_reload_and_abort(
Expand Down Expand Up @@ -317,15 +317,15 @@ def __init__(self, config_entry: ConfigEntry) -> None:
self.options = deepcopy(dict(config_entry.options))

def _create_options_schema(self, coordinator: PlugwiseDataUpdateCoordinator) -> vol.Schema:
interval = DEFAULT_SCAN_INTERVAL[coordinator.api.smile_type] # pw-beta options
interval = DEFAULT_SCAN_INTERVAL[coordinator.api.smile.type] # pw-beta options
schema = {
vol.Optional(
CONF_SCAN_INTERVAL,
default=self.options.get(CONF_SCAN_INTERVAL, interval.seconds),
): vol.All(cv.positive_int, vol.Clamp(min=10)),
} # pw-beta

if coordinator.api.smile_type == THERMOSTAT:
if coordinator.api.smile.type == THERMOSTAT:
schema.update({
vol.Optional(
CONF_HOMEKIT_EMULATION,
Expand Down
32 changes: 16 additions & 16 deletions custom_components/plugwise/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ async def _connect(self) -> None:
self._connected = isinstance(version, Version)
if self._connected:
self.update_interval = DEFAULT_SCAN_INTERVAL.get(
self.api.smile_type, timedelta(seconds=60)
self.api.smile.type, timedelta(seconds=60)
) # pw-beta options scan-interval
if (custom_time := self.config_entry.options.get(CONF_SCAN_INTERVAL)) is not None:
self.update_interval = timedelta(
Expand Down Expand Up @@ -125,7 +125,7 @@ async def _async_update_data(self) -> dict[str, GwEntityData]:
translation_key="unsupported_firmware",
) from err

LOGGER.debug(f"{self.api.smile_name} data: %s", data)
LOGGER.debug(f"{self.api.smile.name} data: %s", data)
await self._async_add_remove_devices(data)
return data

Expand Down Expand Up @@ -154,17 +154,17 @@ async def _async_remove_devices(self, data: dict[str, GwEntityData]) -> None:
# Then remove the connected orphaned device(s)
for device_entry in device_list:
for identifier in device_entry.identifiers:
if identifier[0] == DOMAIN:
if (
device_entry.via_device_id == via_device_id
and identifier[1] not in data
):
device_reg.async_update_device(
device_entry.id, remove_config_entry_id=self.config_entry.entry_id
)
LOGGER.debug(
"Removed %s device/zone %s %s from device_registry",
DOMAIN,
device_entry.model,
identifier[1],
)
if (
identifier[0] == DOMAIN
and device_entry.via_device_id == via_device_id
and identifier[1] not in data
):
device_reg.async_update_device(
device_entry.id, remove_config_entry_id=self.config_entry.entry_id
)
LOGGER.debug(
"Removed %s device/zone %s %s from device_registry",
DOMAIN,
device_entry.model,
identifier[1],
)
2 changes: 1 addition & 1 deletion custom_components/plugwise/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def __init__(
manufacturer=data.get(VENDOR),
model=data.get(MODEL),
model_id=data.get(MODEL_ID),
name=coordinator.api.smile_name,
name=coordinator.api.smile.name,
sw_version=data.get(FIRMWARE),
hw_version=data.get(HARDWARE),
)
Expand Down
4 changes: 2 additions & 2 deletions custom_components/plugwise/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"integration_type": "hub",
"iot_class": "local_polling",
"loggers": ["plugwise"],
"requirements": ["plugwise==1.7.6"],
"version": "0.57.4",
"requirements": ["plugwise==1.7.7"],
"version": "0.57.5",
"zeroconf": ["_plugwise._tcp.local."]
}
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "plugwise-beta"
version = "0.57.4"
version = "0.57.5"
description = "Plugwise beta custom-component"
readme = "README.md"
requires-python = ">=3.13"
Expand Down
Loading
Loading