Skip to content

Commit dbf7e33

Browse files
committed
add some debug output
1 parent cb2de1b commit dbf7e33

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: apps/lightcontroller.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,9 @@ def initialize(self):
145145

146146
self.turn_on_light_enable_entity = self.args.get('turn_on_light_enable_entity', None)
147147
self.turn_on_light_enable_true_value = self.args.get('turn_on_light_enable_true_value', None)
148+
if self.turn_on_light_enable_entity is not None:
149+
self.log("Motion turn on feature is controlled by {} entity with '{}' value".format(
150+
str(self.turn_on_light_enable_entity), str(self.turn_on_light_enable_true_value)))
148151

149152
# Contacts
150153
self.contacts = {}
@@ -312,7 +315,10 @@ def occupancy_data_processing(self, motion_sensor, occupancy):
312315
turn_on_enable = (
313316
self.get_state(self.turn_on_light_enable_entity) == self.turn_on_light_enable_true_value)
314317

315-
if turn_on_enable:
318+
if turn_on_enable is False:
319+
self.log("Light on due to {} ignored, as functionality is disabled via {}"
320+
.format(sensor_name, self.turn_on_light_enable_entity))
321+
else:
316322
self.select_scene(self.default_scene, transition=1)
317323
self.log("Light on due to %s motion sensor (turn_on flag enabled)" % sensor_name)
318324
self.process_light_timeout()

0 commit comments

Comments
 (0)