Bump plugwise to v0.37.2 (#115989)

This commit is contained in:
Bouwe Westerdijk 2024-04-23 22:13:09 +02:00 committed by GitHub
parent f249a9ba4b
commit 2c7a1ddb1d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 35 additions and 15 deletions

View file

@ -49,8 +49,16 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
def async_migrate_entity_entry(entry: er.RegistryEntry) -> dict[str, Any] | None:
"""Migrate Plugwise entity entries.
- Migrates unique ID from old relay switches to the new unique ID
- Migrates old unique ID's from old binary_sensors and switches to the new unique ID's
"""
if entry.domain == Platform.BINARY_SENSOR and entry.unique_id.endswith(
"-slave_boiler_state"
):
return {
"new_unique_id": entry.unique_id.replace(
"-slave_boiler_state", "-secondary_boiler_state"
)
}
if entry.domain == Platform.SWITCH and entry.unique_id.endswith("-plug"):
return {"new_unique_id": entry.unique_id.replace("-plug", "-relay")}

View file

@ -64,8 +64,8 @@ BINARY_SENSORS: tuple[PlugwiseBinarySensorEntityDescription, ...] = (
entity_category=EntityCategory.DIAGNOSTIC,
),
PlugwiseBinarySensorEntityDescription(
key="slave_boiler_state",
translation_key="slave_boiler_state",
key="secondary_boiler_state",
translation_key="secondary_boiler_state",
entity_category=EntityCategory.DIAGNOSTIC,
),
PlugwiseBinarySensorEntityDescription(

View file

@ -7,6 +7,6 @@
"integration_type": "hub",
"iot_class": "local_polling",
"loggers": ["plugwise"],
"requirements": ["plugwise==0.37.1"],
"requirements": ["plugwise==0.37.2"],
"zeroconf": ["_plugwise._tcp.local."]
}

View file

@ -48,7 +48,7 @@
"cooling_state": {
"name": "[%key:component::climate::entity_component::_::state_attributes::hvac_action::state::cooling%]"
},
"slave_boiler_state": {
"secondary_boiler_state": {
"name": "Secondary boiler state"
},
"plugwise_notification": {

View file

@ -1548,7 +1548,7 @@ plexauth==0.0.6
plexwebsocket==0.0.14
# homeassistant.components.plugwise
plugwise==0.37.1
plugwise==0.37.2
# homeassistant.components.plum_lightpad
plumlightpad==0.0.11

View file

@ -1225,7 +1225,7 @@ plexauth==0.0.6
plexwebsocket==0.0.14
# homeassistant.components.plugwise
plugwise==0.37.1
plugwise==0.37.2
# homeassistant.components.plum_lightpad
plumlightpad==0.0.11

View file

@ -25,7 +25,7 @@
"dhw_state": false,
"flame_state": false,
"heating_state": true,
"slave_boiler_state": false
"secondary_boiler_state": false
},
"dev_class": "heater_central",
"location": "a57efe5f145f498c9be62a9b63626fbf",

View file

@ -25,7 +25,7 @@
"dhw_state": false,
"flame_state": false,
"heating_state": false,
"slave_boiler_state": false
"secondary_boiler_state": false
},
"dev_class": "heater_central",
"location": "a57efe5f145f498c9be62a9b63626fbf",

View file

@ -25,7 +25,7 @@
"dhw_state": false,
"flame_state": false,
"heating_state": false,
"slave_boiler_state": false
"secondary_boiler_state": false
},
"dev_class": "heater_central",
"location": "a57efe5f145f498c9be62a9b63626fbf",

View file

@ -136,7 +136,6 @@
"gateway": {
"gateway_id": "0000aaaa0000aaaa0000aaaa0000aa00",
"item_count": 83,
"notifications": {},
"smile_name": "Stretch"
}
}

View file

@ -12,9 +12,8 @@ from plugwise.exceptions import (
import pytest
from homeassistant.components.plugwise.const import DOMAIN
from homeassistant.components.sensor import DOMAIN as SENSOR_DOMAIN
from homeassistant.components.switch import DOMAIN as SWITCH_DOMAIN
from homeassistant.config_entries import ConfigEntryState
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
from homeassistant.helpers import entity_registry as er
@ -22,6 +21,9 @@ from tests.common import MockConfigEntry
HEATER_ID = "1cbf783bb11e4a7c8a6843dee3a86927" # Opentherm device_id for migration
PLUG_ID = "cd0ddb54ef694e11ac18ed1cbce5dbbd" # VCR device_id for migration
SECONDARY_ID = (
"1cbf783bb11e4a7c8a6843dee3a86927" # Heater_central device_id for migration
)
async def test_load_unload_config_entry(
@ -77,7 +79,7 @@ async def test_gateway_config_entry_not_ready(
[
(
{
"domain": SENSOR_DOMAIN,
"domain": Platform.SENSOR,
"platform": DOMAIN,
"unique_id": f"{HEATER_ID}-outdoor_temperature",
"suggested_object_id": f"{HEATER_ID}-outdoor_temperature",
@ -118,7 +120,18 @@ async def test_migrate_unique_id_temperature(
[
(
{
"domain": SWITCH_DOMAIN,
"domain": Platform.BINARY_SENSOR,
"platform": DOMAIN,
"unique_id": f"{SECONDARY_ID}-slave_boiler_state",
"suggested_object_id": f"{SECONDARY_ID}-slave_boiler_state",
"disabled_by": None,
},
f"{SECONDARY_ID}-slave_boiler_state",
f"{SECONDARY_ID}-secondary_boiler_state",
),
(
{
"domain": Platform.SWITCH,
"platform": DOMAIN,
"unique_id": f"{PLUG_ID}-plug",
"suggested_object_id": f"{PLUG_ID}-plug",