Просмотр исходного кода

Shellies for FFW floor and bath added

master
Dirk Alders 2 месяцев назад
Родитель
Сommit
a0375245b4
3 измененных файлов: 38 добавлений и 3 удалений
  1. 1
    1
      devdi
  2. 5
    0
      function/__init__.py
  3. 32
    2
      function/first_floor_west.py

+ 1
- 1
devdi

@@ -1 +1 @@
1
-Subproject commit 66a471979d41bb6477b676dddd3f5959ba0326cc
1
+Subproject commit 8f8ace13c131abf9c4dfb79087fa1c13c76805d2

+ 5
- 0
function/__init__.py Просмотреть файл

@@ -71,6 +71,11 @@ class all_functions(room_collection):
71 71
         # FFE ALL OFF - Long push input device
72 72
         self.ffe.sleep.button_tradfri.add_callback(devices.tradfri_button.KEY_ACTION, devices.tradfri_button.ACTION_RIGHT_LONG, self.ffe.all_off)
73 73
 
74
+        # FFW ALL OFF - Long push ffw_floor
75
+        self.ffw.floor.main_light_shelly.add_callback(self.ffw.floor.main_light_shelly.KEY_LONGPUSH_0,
76
+                                                      True, self.ffw.floor.main_light_shelly.flash_0_mcb)
77
+        self.ffw.floor.main_light_shelly.add_callback(self.ffw.floor.main_light_shelly.KEY_LONGPUSH_0, True, self.ffw.all_off)
78
+
74 79
     def init_sumer_winter_mode(self):
75 80
         # ALL summer/winter mode
76 81
         self.videv_summer_mode = videv_pure_switch(self.mqtt_client, config.TOPIC_ALL_SUMMER_WINTER_MODE)

+ 32
- 2
function/first_floor_west.py Просмотреть файл

@@ -7,7 +7,7 @@ from devdi import topic as props
7 7
 from function.db import get_radiator_data, set_radiator_data
8 8
 from function.modules import heating_function
9 9
 from function.rooms import room, room_collection
10
-from function.videv import videv_switch_brightness, videv_switch_brightness_color_temp, videv_heating
10
+from function.videv import videv_switch_brightness, videv_switch_brightness_color_temp, videv_heating, videv_switching
11 11
 import logging
12 12
 
13 13
 
@@ -23,12 +23,34 @@ loc = props.LOC_FFW
23 23
 class first_floor_west(room_collection):
24 24
     def __init__(self, mqtt_client, pd, vd):
25 25
         super().__init__(mqtt_client, pd, vd)
26
+        self.floor = first_floor_west_floor(mqtt_client, pd, vd)
26 27
         self.bath = first_floor_west_bath(mqtt_client, pd, vd)
27 28
         self.julian = first_floor_west_julian(mqtt_client, pd, vd)
28 29
         self.livingroom = first_floor_west_living(mqtt_client, pd, vd)
29 30
         self.sleep = first_floor_west_sleep(mqtt_client, pd, vd)
30 31
 
31 32
 
33
+class first_floor_west_floor(room):
34
+    def __init__(self, mqtt_client, pd, vd):
35
+        roo = props.ROO_FLO
36
+        #
37
+        # Device initialisation
38
+        #
39
+        # http://shelly1-58BF25D848EA
40
+        # main light
41
+        self.main_light_shelly = pd.get(props.STG_SHE, loc, roo, props.FUN_MAL)
42
+        super().__init__(mqtt_client, pd, vd)
43
+
44
+        #
45
+        # Virtual Device Interface
46
+        #
47
+        # main light
48
+        self.main_light = videv_switching(
49
+            mqtt_client, config.TOPIC_FFE_FLOOR_MAIN_LIGHT_VIDEV,
50
+            self.main_light_shelly, self.main_light_shelly.KEY_OUTPUT_0
51
+        )
52
+
53
+
32 54
 class first_floor_west_julian(room):
33 55
     def __init__(self, mqtt_client, pd, vd):
34 56
         roo = props.ROO_JUL
@@ -76,6 +98,9 @@ class first_floor_west_bath(room):
76 98
         #
77 99
         # Device initialisation
78 100
         #
101
+        # http://shelly1-58BF25D84219
102
+        # main light
103
+        self.main_light_shelly = pd.get(props.STG_SHE, loc, roo, props.FUN_MAL)
79 104
         # heating function
80 105
         self.heating_valve = pd.get(props.STG_ZFW, loc, roo, props.FUN_HEA)
81 106
         super().__init__(mqtt_client, pd, vd)
@@ -94,6 +119,11 @@ class first_floor_west_bath(room):
94 119
         #
95 120
         # Virtual Device Interface
96 121
         #
122
+        # main light
123
+        self.main_light = videv_switching(
124
+            mqtt_client, config.TOPIC_FFE_FLOOR_MAIN_LIGHT_VIDEV,
125
+            self.main_light_shelly, self.main_light_shelly.KEY_OUTPUT_0
126
+        )
97 127
         # heating function
98 128
         self.heating_function_videv = videv_heating(
99 129
             mqtt_client, config.TOPIC_FFW_BATH_HEATING_VALVE_VIDEV,
@@ -157,7 +187,7 @@ class first_floor_west_sleep(room):
157 187
         self.heating_valve = pd.get(props.STG_ZFW, loc, roo, props.FUN_HEA)
158 188
         super().__init__(mqtt_client, pd, vd)
159 189
 
160
-        #  
190
+        #
161 191
         # Functionality initialisation
162 192
         #
163 193
         # heating function

Загрузка…
Отмена
Сохранить