mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Extend Plugwise climate support (#66278)
This commit is contained in:
parent
bd920aa43d
commit
fbd6e9f498
@ -26,7 +26,12 @@ from .coordinator import PlugwiseDataUpdateCoordinator
|
|||||||
from .entity import PlugwiseEntity
|
from .entity import PlugwiseEntity
|
||||||
from .util import plugwise_command
|
from .util import plugwise_command
|
||||||
|
|
||||||
THERMOSTAT_CLASSES = ["thermostat", "zone_thermostat", "thermostatic_radiator_valve"]
|
THERMOSTAT_CLASSES = [
|
||||||
|
"thermostat",
|
||||||
|
"thermostatic_radiator_valve",
|
||||||
|
"zone_thermometer",
|
||||||
|
"zone_thermostat",
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
async def async_setup_entry(
|
async def async_setup_entry(
|
||||||
@ -94,15 +99,20 @@ class PlugwiseClimateEntity(PlugwiseEntity, ClimateEntity):
|
|||||||
@property
|
@property
|
||||||
def hvac_action(self) -> str:
|
def hvac_action(self) -> str:
|
||||||
"""Return the current running hvac operation if supported."""
|
"""Return the current running hvac operation if supported."""
|
||||||
heater_central_data = self.coordinator.data.devices[
|
# When control_state is present, prefer this data
|
||||||
self.coordinator.data.gateway["heater_id"]
|
if "control_state" in self.device:
|
||||||
]
|
if self.device.get("control_state") == "cooling":
|
||||||
|
return CURRENT_HVAC_COOL
|
||||||
if heater_central_data.get("heating_state"):
|
if self.device.get("control_state") == "heating":
|
||||||
return CURRENT_HVAC_HEAT
|
return CURRENT_HVAC_HEAT
|
||||||
if heater_central_data.get("cooling_state"):
|
else:
|
||||||
return CURRENT_HVAC_COOL
|
heater_central_data = self.coordinator.data.devices[
|
||||||
|
self.coordinator.data.gateway["heater_id"]
|
||||||
|
]
|
||||||
|
if heater_central_data.get("heating_state"):
|
||||||
|
return CURRENT_HVAC_HEAT
|
||||||
|
if heater_central_data.get("cooling_state"):
|
||||||
|
return CURRENT_HVAC_COOL
|
||||||
return CURRENT_HVAC_IDLE
|
return CURRENT_HVAC_IDLE
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
Loading…
x
Reference in New Issue
Block a user