Smarthome Functionen
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

stairway.py 1.0KB

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/env python
  2. # -*- coding: utf-8 -*-
  3. #
  4. import config
  5. import devices
  6. from function.modules import brightness_choose_n_action
  7. import logging
  8. from function.rooms import room_shelly_motion_sensor
  9. from function.videv import videv_switching
  10. try:
  11. from config import APP_NAME as ROOT_LOGGER_NAME
  12. except ImportError:
  13. ROOT_LOGGER_NAME = 'root'
  14. logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__)
  15. class stairway(room_shelly_motion_sensor):
  16. def __init__(self, mqtt_client):
  17. # http://shelly1-3494546A9364
  18. super().__init__(mqtt_client, config.TOPIC_STW_STAIRWAY_MAIN_LIGHT_SHELLY, config.TOPIC_STW_STAIRWAY_MAIN_LIGHT_GUI,
  19. config.TOPIC_STW_STAIRWAY_MAIN_LIGHT_MOTION_SENSOR_GF, config.TOPIC_STW_STAIRWAY_MAIN_LIGHT_MOTION_SENSOR_FF,
  20. timer_value=config.USER_ON_TIME_STAIRWAYS)
  21. #
  22. self.main_light_videv = videv_switching(
  23. mqtt_client, config.TOPIC_STW_STAIRWAY_MAIN_LIGHT_VIDEV,
  24. self.main_light_shelly, devices.shelly.KEY_OUTPUT_0
  25. )