# # Devices within our homeauto solution. # import collections # board: int # the MOSFET control board # id: str # for this particular string of lights # name: str # human-readable # pin: int # GPIO pin on the Pico controller _L24 = collections.namedtuple('_L24', ('board', 'id', 'name', 'pin')) # Lights connected to the 24VDC controller (a single Pico W) LIGHTS_24 = { # Board #1, ordered by pin/cable _L24(1, 'ht', 'Home Theater', 6,), # GP4, PWM-2A _L24(1, 'gread', 'Guest Reading', 7,), # GP5, PWM-2B _L24(1, 'laundry', 'Laundry', 9,), # GP6, PWM-3A _L24(1, 'kitchen', 'Kitchen', 10,), # GP7, PWM-3B _L24(1, 'pantry', 'Pantry', 11,), # GP8, PWM-4A _L24(1, 'server', 'Server Room', 12,), # GP9, PWM-4B _L24(1, 'n/c', '', 0,), _L24(1, 'GND', '', 13,), # GND # Board #2, ordered by pin/cable _L24(2, 'hfront', 'Hall (front)', 14,), # GP10, PWM-5A _L24(2, 'bar', 'Bar', 15,), # GP11, PWM-5B _L24(2, 'hback', 'Hall (back)', 16,), # GP12, PWM-6A _L24(2, 'exercise', 'Exercise', 17,), # GP13, PWM-6B _L24(2, 'gcloset', 'Greg\'s Closet', 19,), # GP14, PWM-7A _L24(2, 'mread', 'Master Reading', 20,), # GP15, PWM-7B _L24(2, 'n/c', '', 0,), _L24(2, 'GND', '', 18,), # GND, ribbon crossover # Board #3, ordered by pin/cable _L24(3, 'foyer', 'Foyer', 21,), # GP16, PWM-0A _L24(3, 'gbath', 'Guest Bath', 22,), # GP17, PWM-0B _L24(3, 'n/c', '', 0,), _L24(3, 'hmid', 'Hall (mid)', 24,), # GP18, PWM-1A _L24(3, 'mbath', 'Master Bathroom', 25,), # GP19, PWM-1B _L24(3, 'n/c', '', 0,), _L24(3, 'n/c', '', 0,), _L24(3, 'GND', '', 28,), # GND } # Lights connected to the 110VAC controller (TBD; another Pico) LIGHTS_110 = set() # Momentary switches connected to (TBD) Pico controller SWITCHES = set()