Bump plugwise to v0.37.2 (#115989)
This commit is contained in:
parent
f249a9ba4b
commit
2c7a1ddb1d
11 changed files with 35 additions and 15 deletions
|
@ -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:
|
def async_migrate_entity_entry(entry: er.RegistryEntry) -> dict[str, Any] | None:
|
||||||
"""Migrate Plugwise entity entries.
|
"""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"):
|
if entry.domain == Platform.SWITCH and entry.unique_id.endswith("-plug"):
|
||||||
return {"new_unique_id": entry.unique_id.replace("-plug", "-relay")}
|
return {"new_unique_id": entry.unique_id.replace("-plug", "-relay")}
|
||||||
|
|
||||||
|
|
|
@ -64,8 +64,8 @@ BINARY_SENSORS: tuple[PlugwiseBinarySensorEntityDescription, ...] = (
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
),
|
),
|
||||||
PlugwiseBinarySensorEntityDescription(
|
PlugwiseBinarySensorEntityDescription(
|
||||||
key="slave_boiler_state",
|
key="secondary_boiler_state",
|
||||||
translation_key="slave_boiler_state",
|
translation_key="secondary_boiler_state",
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
),
|
),
|
||||||
PlugwiseBinarySensorEntityDescription(
|
PlugwiseBinarySensorEntityDescription(
|
||||||
|
|
|
@ -7,6 +7,6 @@
|
||||||
"integration_type": "hub",
|
"integration_type": "hub",
|
||||||
"iot_class": "local_polling",
|
"iot_class": "local_polling",
|
||||||
"loggers": ["plugwise"],
|
"loggers": ["plugwise"],
|
||||||
"requirements": ["plugwise==0.37.1"],
|
"requirements": ["plugwise==0.37.2"],
|
||||||
"zeroconf": ["_plugwise._tcp.local."]
|
"zeroconf": ["_plugwise._tcp.local."]
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,7 +48,7 @@
|
||||||
"cooling_state": {
|
"cooling_state": {
|
||||||
"name": "[%key:component::climate::entity_component::_::state_attributes::hvac_action::state::cooling%]"
|
"name": "[%key:component::climate::entity_component::_::state_attributes::hvac_action::state::cooling%]"
|
||||||
},
|
},
|
||||||
"slave_boiler_state": {
|
"secondary_boiler_state": {
|
||||||
"name": "Secondary boiler state"
|
"name": "Secondary boiler state"
|
||||||
},
|
},
|
||||||
"plugwise_notification": {
|
"plugwise_notification": {
|
||||||
|
|
|
@ -1548,7 +1548,7 @@ plexauth==0.0.6
|
||||||
plexwebsocket==0.0.14
|
plexwebsocket==0.0.14
|
||||||
|
|
||||||
# homeassistant.components.plugwise
|
# homeassistant.components.plugwise
|
||||||
plugwise==0.37.1
|
plugwise==0.37.2
|
||||||
|
|
||||||
# homeassistant.components.plum_lightpad
|
# homeassistant.components.plum_lightpad
|
||||||
plumlightpad==0.0.11
|
plumlightpad==0.0.11
|
||||||
|
|
|
@ -1225,7 +1225,7 @@ plexauth==0.0.6
|
||||||
plexwebsocket==0.0.14
|
plexwebsocket==0.0.14
|
||||||
|
|
||||||
# homeassistant.components.plugwise
|
# homeassistant.components.plugwise
|
||||||
plugwise==0.37.1
|
plugwise==0.37.2
|
||||||
|
|
||||||
# homeassistant.components.plum_lightpad
|
# homeassistant.components.plum_lightpad
|
||||||
plumlightpad==0.0.11
|
plumlightpad==0.0.11
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
"dhw_state": false,
|
"dhw_state": false,
|
||||||
"flame_state": false,
|
"flame_state": false,
|
||||||
"heating_state": true,
|
"heating_state": true,
|
||||||
"slave_boiler_state": false
|
"secondary_boiler_state": false
|
||||||
},
|
},
|
||||||
"dev_class": "heater_central",
|
"dev_class": "heater_central",
|
||||||
"location": "a57efe5f145f498c9be62a9b63626fbf",
|
"location": "a57efe5f145f498c9be62a9b63626fbf",
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
"dhw_state": false,
|
"dhw_state": false,
|
||||||
"flame_state": false,
|
"flame_state": false,
|
||||||
"heating_state": false,
|
"heating_state": false,
|
||||||
"slave_boiler_state": false
|
"secondary_boiler_state": false
|
||||||
},
|
},
|
||||||
"dev_class": "heater_central",
|
"dev_class": "heater_central",
|
||||||
"location": "a57efe5f145f498c9be62a9b63626fbf",
|
"location": "a57efe5f145f498c9be62a9b63626fbf",
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
"dhw_state": false,
|
"dhw_state": false,
|
||||||
"flame_state": false,
|
"flame_state": false,
|
||||||
"heating_state": false,
|
"heating_state": false,
|
||||||
"slave_boiler_state": false
|
"secondary_boiler_state": false
|
||||||
},
|
},
|
||||||
"dev_class": "heater_central",
|
"dev_class": "heater_central",
|
||||||
"location": "a57efe5f145f498c9be62a9b63626fbf",
|
"location": "a57efe5f145f498c9be62a9b63626fbf",
|
||||||
|
|
|
@ -136,7 +136,6 @@
|
||||||
"gateway": {
|
"gateway": {
|
||||||
"gateway_id": "0000aaaa0000aaaa0000aaaa0000aa00",
|
"gateway_id": "0000aaaa0000aaaa0000aaaa0000aa00",
|
||||||
"item_count": 83,
|
"item_count": 83,
|
||||||
"notifications": {},
|
|
||||||
"smile_name": "Stretch"
|
"smile_name": "Stretch"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,9 +12,8 @@ from plugwise.exceptions import (
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from homeassistant.components.plugwise.const import DOMAIN
|
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.config_entries import ConfigEntryState
|
||||||
|
from homeassistant.const import Platform
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers import entity_registry as er
|
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
|
HEATER_ID = "1cbf783bb11e4a7c8a6843dee3a86927" # Opentherm device_id for migration
|
||||||
PLUG_ID = "cd0ddb54ef694e11ac18ed1cbce5dbbd" # VCR 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(
|
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,
|
"platform": DOMAIN,
|
||||||
"unique_id": f"{HEATER_ID}-outdoor_temperature",
|
"unique_id": f"{HEATER_ID}-outdoor_temperature",
|
||||||
"suggested_object_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,
|
"platform": DOMAIN,
|
||||||
"unique_id": f"{PLUG_ID}-plug",
|
"unique_id": f"{PLUG_ID}-plug",
|
||||||
"suggested_object_id": f"{PLUG_ID}-plug",
|
"suggested_object_id": f"{PLUG_ID}-plug",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue