-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstatus.py
More file actions
20 lines (16 loc) · 742 Bytes
/
Copy pathstatus.py
File metadata and controls
20 lines (16 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Custom magicmirror effects with NeoPixel library
# Author: Adasinho (adirm10@yahoo.com)
import motion_sensor_controller
import dusk_sensor_controller
# Class to control LEDs
class Status:
def __init__(self):
self.motionSensorController = motion_sensor_controller.MotionSensorController()
self.duskSensorController = dusk_sensor_controller.DuskSensorController()
def checkpoint(self):
self.motionSensorController.update()
self.duskSensorController.update()
if self.duskSensorController.get_light_status(): # If dark
if not self.motionSensorController.get_motion_status(): # When nobody is move
return True # Can animate
return False # Can't animate