Fix bug with 1st gen RainMachine controllers and unknown API calls (#78070)
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
This commit is contained in:
parent
52d2ebd2c8
commit
9fc9d50e07
6 changed files with 23 additions and 11 deletions
|
@ -273,12 +273,14 @@ class ProvisionSettingsSensor(RainMachineEntity, SensorEntity):
|
|||
def update_from_latest_data(self) -> None:
|
||||
"""Update the state."""
|
||||
if self.entity_description.key == TYPE_FLOW_SENSOR_CLICK_M3:
|
||||
self._attr_native_value = self.coordinator.data["system"].get(
|
||||
self._attr_native_value = self.coordinator.data.get("system", {}).get(
|
||||
"flowSensorClicksPerCubicMeter"
|
||||
)
|
||||
elif self.entity_description.key == TYPE_FLOW_SENSOR_CONSUMED_LITERS:
|
||||
clicks = self.coordinator.data["system"].get("flowSensorWateringClicks")
|
||||
clicks_per_m3 = self.coordinator.data["system"].get(
|
||||
clicks = self.coordinator.data.get("system", {}).get(
|
||||
"flowSensorWateringClicks"
|
||||
)
|
||||
clicks_per_m3 = self.coordinator.data.get("system", {}).get(
|
||||
"flowSensorClicksPerCubicMeter"
|
||||
)
|
||||
|
||||
|
@ -287,11 +289,11 @@ class ProvisionSettingsSensor(RainMachineEntity, SensorEntity):
|
|||
else:
|
||||
self._attr_native_value = None
|
||||
elif self.entity_description.key == TYPE_FLOW_SENSOR_START_INDEX:
|
||||
self._attr_native_value = self.coordinator.data["system"].get(
|
||||
self._attr_native_value = self.coordinator.data.get("system", {}).get(
|
||||
"flowSensorStartIndex"
|
||||
)
|
||||
elif self.entity_description.key == TYPE_FLOW_SENSOR_WATERING_CLICKS:
|
||||
self._attr_native_value = self.coordinator.data["system"].get(
|
||||
self._attr_native_value = self.coordinator.data.get("system", {}).get(
|
||||
"flowSensorWateringClicks"
|
||||
)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue