mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
RainMachine: Add time remaining as a zone attribute (#36361)
This commit is contained in:
parent
e6fe34e64d
commit
cc4326276e
@ -22,7 +22,6 @@ from .const import (
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
ATTR_NEXT_RUN = "next_run"
|
||||
ATTR_AREA = "area"
|
||||
ATTR_CS_ON = "cs_on"
|
||||
ATTR_CURRENT_CYCLE = "current_cycle"
|
||||
@ -30,6 +29,7 @@ ATTR_CYCLES = "cycles"
|
||||
ATTR_DELAY = "delay"
|
||||
ATTR_DELAY_ON = "delay_on"
|
||||
ATTR_FIELD_CAPACITY = "field_capacity"
|
||||
ATTR_NEXT_RUN = "next_run"
|
||||
ATTR_NO_CYCLES = "number_of_cycles"
|
||||
ATTR_PRECIP_RATE = "sprinkler_head_precipitation_rate"
|
||||
ATTR_RESTRICTIONS = "restrictions"
|
||||
@ -39,6 +39,7 @@ ATTR_SOIL_TYPE = "soil_type"
|
||||
ATTR_SPRINKLER_TYPE = "sprinkler_head_type"
|
||||
ATTR_STATUS = "status"
|
||||
ATTR_SUN_EXPOSURE = "sun_exposure"
|
||||
ATTR_TIME_REMAINING = "time_remaining"
|
||||
ATTR_VEGETATION_TYPE = "vegetation_type"
|
||||
ATTR_ZONES = "zones"
|
||||
|
||||
@ -289,10 +290,10 @@ class RainMachineZone(RainMachineSwitch):
|
||||
|
||||
self._attrs.update(
|
||||
{
|
||||
ATTR_ID: self._switch_data["uid"],
|
||||
ATTR_AREA: details.get("waterSense").get("area"),
|
||||
ATTR_CURRENT_CYCLE: self._switch_data.get("cycle"),
|
||||
ATTR_FIELD_CAPACITY: details.get("waterSense").get("fieldCapacity"),
|
||||
ATTR_ID: self._switch_data["uid"],
|
||||
ATTR_NO_CYCLES: self._switch_data.get("noOfCycles"),
|
||||
ATTR_PRECIP_RATE: details.get("waterSense").get("precipitationRate"),
|
||||
ATTR_RESTRICTIONS: self._switch_data.get("restriction"),
|
||||
@ -300,6 +301,7 @@ class RainMachineZone(RainMachineSwitch):
|
||||
ATTR_SOIL_TYPE: SOIL_TYPE_MAP.get(details.get("sun")),
|
||||
ATTR_SPRINKLER_TYPE: SPRINKLER_TYPE_MAP.get(details.get("group_id")),
|
||||
ATTR_SUN_EXPOSURE: SUN_EXPOSURE_MAP.get(details.get("sun")),
|
||||
ATTR_TIME_REMAINING: self._switch_data.get("remaining"),
|
||||
ATTR_VEGETATION_TYPE: VEGETATION_MAP.get(self._switch_data.get("type")),
|
||||
}
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user