Update Rachio hose timer battery sensor (#118045)

pull/118037/head^2
Brian Rogers 2024-05-24 09:31:05 -04:00 committed by GitHub
parent 0b4f1cff98
commit 080bba5d9b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -20,6 +20,7 @@ from .const import (
KEY_DEVICE_ID,
KEY_LOW,
KEY_RAIN_SENSOR_TRIPPED,
KEY_REPLACE,
KEY_REPORTED_STATE,
KEY_STATE,
KEY_STATUS,
@ -171,4 +172,7 @@ class RachioHoseTimerBattery(RachioHoseTimerEntity, BinarySensorEntity):
data = self.coordinator.data[self.id]
self._static_attrs = data[KEY_STATE][KEY_REPORTED_STATE]
self._attr_is_on = self._static_attrs[KEY_BATTERY_STATUS] == KEY_LOW
self._attr_is_on = self._static_attrs[KEY_BATTERY_STATUS] in [
KEY_LOW,
KEY_REPLACE,
]

View File

@ -58,6 +58,7 @@ KEY_CURRENT_STATUS = "lastWateringAction"
KEY_DETECT_FLOW = "detectFlow"
KEY_BATTERY_STATUS = "batteryStatus"
KEY_LOW = "LOW"
KEY_REPLACE = "REPLACE"
KEY_REASON = "reason"
KEY_DEFAULT_RUNTIME = "defaultRuntimeSeconds"
KEY_DURATION_SECONDS = "durationSeconds"