38 lines
1.2 KiB
Python
38 lines
1.2 KiB
Python
#!/usr/bin/env python
|
|
# -*- coding: utf-8 -*-
|
|
#
|
|
|
|
import config
|
|
from devdi import rooms
|
|
import logging
|
|
from function.modules import motion_sensor_light
|
|
from function.rooms import room, room_collection
|
|
|
|
try:
|
|
from config import APP_NAME as ROOT_LOGGER_NAME
|
|
except ImportError:
|
|
ROOT_LOGGER_NAME = 'root'
|
|
logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__)
|
|
|
|
|
|
class stairway(room_collection):
|
|
def __init__(self, mqtt_client):
|
|
super().__init__(mqtt_client)
|
|
self.stairway = stairway_stairway(mqtt_client)
|
|
|
|
|
|
class stairway_stairway(rooms.stairway, room):
|
|
def __init__(self, mqtt_client):
|
|
super().__init__(mqtt_client)
|
|
room.__init__(self, mqtt_client)
|
|
#
|
|
# connect videv and switch
|
|
self.videv_main_light.connect_sw_device(self.switch_main_light, self.switch_main_light.KEY_OUTPUT_0)
|
|
|
|
self.motion_sensor_light = motion_sensor_light(
|
|
self.switch_main_light, self.switch_main_light.set_output_0,
|
|
self.motion_main_light_gf, self.motion_main_light_ff,
|
|
timer_value=config.USER_ON_TIME_STAIRWAYS
|
|
)
|
|
self.videv_main_light.connect_mo_function(self.motion_sensor_light)
|