Skip to content

Commit

Permalink
Fix KeyError from Rain Delay binary sensor if no key exists on the de…
Browse files Browse the repository at this point in the history
…vice status

Fixes #7
  • Loading branch information
sebr committed Mar 12, 2020
1 parent d9a47df commit d26fd2c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/bhyve/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def _setup(self, device):
self._attrs = {}
self._available = device.get("is_connected", False)

device_status = device["status"]
rain_delay = device_status["rain_delay"]
device_status = device.get("status", {})
rain_delay = device_status.get("rain_delay")

self._update_device_cb = None
self._extract_rain_delay(rain_delay, device_status)
Expand Down

0 comments on commit d26fd2c

Please sign in to comment.