mirror of
https://github.com/thecode/ha-rpi_gpio.git
synced 2025-07-24 11:16:38 +00:00
Fix binary sensor exception (#27)
This commit is contained in:
parent
2fc521bee4
commit
a299ca4db9
@ -82,7 +82,8 @@ class RPiGPIOBinarySensor(BinarySensorEntity):
|
||||
|
||||
def edge_detected(port):
|
||||
"""Edge detection handler."""
|
||||
self.hass.add_job(self.async_read_gpio)
|
||||
if self.hass is not None:
|
||||
self.hass.add_job(self.async_read_gpio)
|
||||
|
||||
edge_detect(self._port, edge_detected, self._bouncetime)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user