diff --git a/function/__init__.py b/function/__init__.py index 877e62a..54eac65 100644 --- a/function/__init__.py +++ b/function/__init__.py @@ -2,6 +2,7 @@ # -*- coding: utf-8 -*- # import devices +from function.stairway import stairway from function.ground_floor_west import ground_floor_west_floor, ground_floor_west_marion, ground_floor_west_dirk from function.first_floor_west import first_floor_west_julian, first_floor_west_living from function.first_floor_east import first_floor_east_floor, first_floor_east_kitchen, first_floor_east_dining, first_floor_east_sleep, first_floor_east_living @@ -15,12 +16,10 @@ except ImportError: ROOT_LOGGER_NAME = 'root' logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__) -# TODO: topics and parameters -> config.py # TODO: implement devices.nodered_gui_timer (for circulation pump) # implement devices.nodered_gui_heatvalve incl. setpoint, boost, ... and functions from funtion.module # improve devices.brennenstuhl_heatvalve # improve the implementation in common if highly reduced, just move it to function.__init__.py -# # TODO: implement garland (incl. day events like sunset, sunrise, ...) # TODO: implement warning message @@ -33,6 +32,8 @@ class all_functions(object): # heating and warm water self.common_ffe_heat_sleep = common_heating(self.mqtt_client) self.common_circulation_pump = common_circulation_pump(self.mqtt_client) + # stairway + self.stw_stairway = stairway(self.mqtt_client) # ground floor west self.gfw_floor = ground_floor_west_floor(self.mqtt_client) self.gfw_marion = ground_floor_west_marion(self.mqtt_client) diff --git a/function/first_floor_east.py b/function/first_floor_east.py index 130122c..8a03f9b 100644 --- a/function/first_floor_east.py +++ b/function/first_floor_east.py @@ -14,11 +14,10 @@ except ImportError: logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__) -class first_floor_east_floor(room_shelly_motion_sensor): +class first_floor_east_floor(room_shelly): def __init__(self, mqtt_client): # http://shelly1l-3C6105E4E629 - super().__init__(mqtt_client, config.TOPIC_FFE_FLOOR_MAIN_LIGHT_SHELLY, - config.TOPIC_FFE_FLOOR_MAIN_LIGHT_GUI_SWITCH, config.TOPIC_FFE_FLOOR_MAIN_LIGHT_MOTION_SENSOR) + super().__init__(mqtt_client, config.TOPIC_FFE_FLOOR_MAIN_LIGHT_SHELLY, config.TOPIC_FFE_FLOOR_MAIN_LIGHT_GUI_SWITCH) class first_floor_east_kitchen(room_shelly): diff --git a/function/stairway.py b/function/stairway.py new file mode 100644 index 0000000..dd527e9 --- /dev/null +++ b/function/stairway.py @@ -0,0 +1,21 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- +# + +import config +from function.modules import brightness_choose_n_action +import logging +from function.rooms import room_shelly_motion_sensor +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_shelly_motion_sensor): + def __init__(self, mqtt_client): + # http:// + super().__init__(mqtt_client, config.TOPIC_STW_STAIRWAY_MAIN_LIGHT_SHELLY, config.TOPIC_STW_STAIRWAY_MAIN_LIGHT_GUI_SWITCH, + config.TOPIC_STW_STAIRWAY_MAIN_LIGHT_MOTION_SENSOR_GF, + config.TOPIC_STW_STAIRWAY_MAIN_LIGHT_MOTION_SENSOR_FF, config.TOPIC_STW_STAIRWAY_MAIN_LIGHT_MIN_ON_TIME)