Skip to content

Commit 4b3e8d1

Browse files
authored
Merge pull request #5 from macros0/patch-2
Error correction in the _on_off method
2 parents c15fa17 + 9616bdc commit 4b3e8d1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

custom_components/binary_sensor/NooLite.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ def _on_on(self):
113113
self._timer.start()
114114

115115
def _on_off(self):
116-
self._timer.cancel()
116+
if self._timer is not None:
117+
self._timer.cancel()
117118
self._timer = None
118119
self._switch_off()
119120
self.schedule_update_ha_state()

0 commit comments

Comments
 (0)