Plugwise bump module version to fix heating-state and OnOff devices (#66936)

This commit is contained in:
Tom 2022-02-20 20:45:19 +01:00 committed by GitHub
parent 8c96f1457d
commit 620b653d76
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 25 additions and 50 deletions

View file

@ -107,15 +107,16 @@ class PlugwiseClimateEntity(PlugwiseEntity, ClimateEntity):
if "control_state" in self.device:
if self.device.get("control_state") == "cooling":
return CURRENT_HVAC_COOL
if self.device.get("control_state") == "heating":
# Support preheating state as heating, until preheating is added as a separate state
if self.device.get("control_state") in ["heating", "preheating"]:
return CURRENT_HVAC_HEAT
else:
heater_central_data = self.coordinator.data.devices[
self.coordinator.data.gateway["heater_id"]
]
if heater_central_data.get("heating_state"):
if heater_central_data["binary_sensors"].get("heating_state"):
return CURRENT_HVAC_HEAT
if heater_central_data.get("cooling_state"):
if heater_central_data["binary_sensors"].get("cooling_state"):
return CURRENT_HVAC_COOL
return CURRENT_HVAC_IDLE

View file

@ -25,7 +25,6 @@ PLATFORMS_GATEWAY = [
Platform.SENSOR,
Platform.SWITCH,
]
SENSOR_PLATFORMS = [Platform.SENSOR, Platform.SWITCH]
ZEROCONF_MAP = {
"smile": "P1",
"smile_thermo": "Anna",

View file

@ -16,14 +16,7 @@ from homeassistant.helpers import device_registry as dr
from homeassistant.helpers.aiohttp_client import async_get_clientsession
from homeassistant.helpers.entity_registry import RegistryEntry, async_migrate_entries
from .const import (
DEFAULT_PORT,
DEFAULT_USERNAME,
DOMAIN,
LOGGER,
PLATFORMS_GATEWAY,
SENSOR_PLATFORMS,
)
from .const import DEFAULT_PORT, DEFAULT_USERNAME, DOMAIN, LOGGER, PLATFORMS_GATEWAY
from .coordinator import PlugwiseDataUpdateCoordinator
@ -77,11 +70,7 @@ async def async_setup_entry_gw(hass: HomeAssistant, entry: ConfigEntry) -> bool:
sw_version=api.smile_version[0],
)
platforms = PLATFORMS_GATEWAY
if coordinator.data.gateway["single_master_thermostat"] is None:
platforms = SENSOR_PLATFORMS
hass.config_entries.async_setup_platforms(entry, platforms)
hass.config_entries.async_setup_platforms(entry, PLATFORMS_GATEWAY)
return True

View file

@ -2,7 +2,7 @@
"domain": "plugwise",
"name": "Plugwise",
"documentation": "https://www.home-assistant.io/integrations/plugwise",
"requirements": ["plugwise==0.16.5"],
"requirements": ["plugwise==0.16.6"],
"codeowners": ["@CoMPaTech", "@bouwew", "@brefra", "@frenck"],
"zeroconf": ["_plugwise._tcp.local."],
"config_flow": true,

View file

@ -1267,7 +1267,7 @@ plexauth==0.0.6
plexwebsocket==0.0.13
# homeassistant.components.plugwise
plugwise==0.16.5
plugwise==0.16.6
# homeassistant.components.plum_lightpad
plumlightpad==0.0.11

View file

@ -795,7 +795,7 @@ plexauth==0.0.6
plexwebsocket==0.0.13
# homeassistant.components.plugwise
plugwise==0.16.5
plugwise==0.16.6
# homeassistant.components.plum_lightpad
plumlightpad==0.0.11

View file

@ -1,11 +1,9 @@
[
{
"active_device": true,
"cooling_present": false,
"smile_name": "Adam",
"gateway_id": "fe799307f1624099878210aa0b9f1475",
"heater_id": "90986d591dcd426cae3ec3e8111ff730",
"single_master_thermostat": false,
"smile_name": "Adam",
"cooling_present": false,
"notifications": {
"af82e4ccf9c548528166d38e560662a4": {
"warning": "Node Plug (with MAC address 000D6F000D13CB01, in room 'n.a.') has been unreachable since 23:03 2020-01-18. Please check the connection and restart the device."
@ -260,8 +258,9 @@
"lower_bound": 10,
"upper_bound": 90,
"resolution": 1,
"cooling_active": false,
"heating_state": true,
"binary_sensors": {
"heating_state": true
},
"sensors": {
"water_temperature": 70.0,
"intended_boiler_temperature": 70.0,

View file

@ -1,11 +1,9 @@
[
{
"active_device": true,
"cooling_present": true,
"smile_name": "Anna",
"gateway_id": "015ae9ea3f964e668e490fa39da3870b",
"heater_id": "1cbf783bb11e4a7c8a6843dee3a86927",
"single_master_thermostat": true,
"smile_name": "Anna",
"cooling_present": true,
"notifications": {}
},
{
@ -21,12 +19,11 @@
"lower_bound": -10,
"upper_bound": 40,
"resolution": 1,
"heating_state": true,
"compressor_state": true,
"cooling_state": false,
"cooling_active": false,
"binary_sensors": {
"dhw_state": false,
"heating_state": true,
"cooling_state": false,
"slave_boiler_state": false,
"flame_state": false
},
@ -40,7 +37,8 @@
},
"switches": {
"dhw_cm_switch": false
}
},
"cooling_active": false
},
"015ae9ea3f964e668e490fa39da3870b": {
"class": "gateway",

View file

@ -1,11 +1,7 @@
[
{
"active_device": false,
"cooling_present": false,
"gateway_id": "e950c7d5e1ee407a858e2a8b5016c8b3",
"heater_id": null,
"single_master_thermostat": false,
"smile_name": "P1",
"gateway_id": "e950c7d5e1ee407a858e2a8b5016c8b3",
"notifications": {}
},
{

View file

@ -1,11 +1,7 @@
[
{
"active_device": false,
"cooling_present": false,
"gateway_id": "0000aaaa0000aaaa0000aaaa0000aa00",
"heater_id": null,
"single_master_thermostat": false,
"smile_name": "Stretch",
"gateway_id": "0000aaaa0000aaaa0000aaaa0000aa00",
"notifications": {}
},
{

View file

@ -20,12 +20,10 @@ async def test_diagnostics(
hass, hass_client, init_integration
) == {
"gateway": {
"active_device": True,
"cooling_present": False,
"smile_name": "Adam",
"gateway_id": "fe799307f1624099878210aa0b9f1475",
"heater_id": "90986d591dcd426cae3ec3e8111ff730",
"single_master_thermostat": False,
"smile_name": "Adam",
"cooling_present": False,
"notifications": {
"af82e4ccf9c548528166d38e560662a4": {
"warning": "Node Plug (with MAC address 000D6F000D13CB01, in room 'n.a.') has been unreachable since 23:03 2020-01-18. Please check the connection and restart the device."
@ -221,8 +219,7 @@ async def test_diagnostics(
"lower_bound": 10,
"upper_bound": 90,
"resolution": 1,
"cooling_active": False,
"heating_state": True,
"binary_sensors": {"heating_state": True},
"sensors": {
"water_temperature": 70.0,
"intended_boiler_temperature": 70.0,