mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 03:07:37 +00:00
add zone status attribute so we can know if queued (#39133)
Before this proposed change, all of the zones related to a running program turn "on", but it's not possible to know which zone is actually running (vs. queued). Adding the mapped state values (they are the same as program status values) as an attribute will allow inspection of all 3 states.
This commit is contained in:
parent
69de68c025
commit
fa09a93cfe
@ -45,7 +45,7 @@ ATTR_ZONES = "zones"
|
||||
|
||||
DAYS = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"]
|
||||
|
||||
PROGRAM_STATUS_MAP = {0: "Not Running", 1: "Running", 2: "Queued"}
|
||||
RUN_STATUS_MAP = {0: "Not Running", 1: "Running", 2: "Queued"}
|
||||
|
||||
SOIL_TYPE_MAP = {
|
||||
0: "Not Set",
|
||||
@ -233,7 +233,7 @@ class RainMachineProgram(RainMachineSwitch):
|
||||
ATTR_ID: self._switch_data["uid"],
|
||||
ATTR_NEXT_RUN: next_run,
|
||||
ATTR_SOAK: self._switch_data.get("soak"),
|
||||
ATTR_STATUS: PROGRAM_STATUS_MAP[self._switch_data["status"]],
|
||||
ATTR_STATUS: RUN_STATUS_MAP[self._switch_data["status"]],
|
||||
ATTR_ZONES: ", ".join(z["name"] for z in self.zones),
|
||||
}
|
||||
)
|
||||
@ -290,6 +290,7 @@ class RainMachineZone(RainMachineSwitch):
|
||||
|
||||
self._attrs.update(
|
||||
{
|
||||
ATTR_STATUS: RUN_STATUS_MAP[self._switch_data["state"]],
|
||||
ATTR_AREA: details.get("waterSense").get("area"),
|
||||
ATTR_CURRENT_CYCLE: self._switch_data.get("cycle"),
|
||||
ATTR_FIELD_CAPACITY: details.get("waterSense").get("fieldCapacity"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user