1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Update pyrainbird to version 0.2.1 to fix zone number (#26064)

* Update pyrainbird to version 0.2.0 to fix zone number issue:

- home-assistant/home-assistant/issues/24519
- jbarrancos/pyrainbird/issues/5
- https://community.home-assistant.io/t/rainbird-zone-switches-5-8-dont-correspond/104705

* requirements_all.txt regenerated

* code formatting

* code formatting

* response checking

* fixed switch state

* pyrainbird version bump

* formatting

* version bump

* if instead elif
This commit is contained in:
Petr Vraník
2019-08-20 18:26:15 +02:00
committed by Martin Hjelmare
parent a347a41d3c
commit 0e4504296e
5 changed files with 20 additions and 9 deletions

View File

@@ -56,7 +56,11 @@ class RainBirdSensor(Entity):
"""Get the latest data and updates the states."""
_LOGGER.debug("Updating sensor: %s", self._name)
if self._sensor_type == "rainsensor":
self._state = self._controller.currentRainSensorState()
result = self._controller.currentRainSensorState()
if result and result["type"] == "CurrentRainSensorStateResponse":
self._state = result["sensorState"]
else:
self._state = None
@property
def name(self):