Browse Source

tradfri dock added for gfw/dirk

master
Dirk Alders 5 months ago
parent
commit
24297fae5f
2 changed files with 7 additions and 7 deletions
  1. 1
    1
      devdi
  2. 6
    6
      function/ground_floor_west.py

+ 1
- 1
devdi

1
-Subproject commit 2e66d0e27416739a8e5c1fa096490882f1b9643c
1
+Subproject commit fc1f86ab5aa532373f628a27fd181a4fe627e718

+ 6
- 6
function/ground_floor_west.py View File

116
         # powerplug
116
         # powerplug
117
         self.powerplug_common = pd.get(props.STG_MYA, loc, roo, props.FUN_MPP)
117
         self.powerplug_common = pd.get(props.STG_MYA, loc, roo, props.FUN_MPP)
118
         self.KEY_POWERPLUG_AMPLIFIER = self.powerplug_common.KEY_OUTPUT_0
118
         self.KEY_POWERPLUG_AMPLIFIER = self.powerplug_common.KEY_OUTPUT_0
119
-        self.KEY_POWERPLUG_DESK_LIGHT = self.powerplug_common.KEY_OUTPUT_1
120
         self.KEY_POWERPLUG_CD_PLAYER = self.powerplug_common.KEY_OUTPUT_2
119
         self.KEY_POWERPLUG_CD_PLAYER = self.powerplug_common.KEY_OUTPUT_2
121
-        self.KEY_POWERPLUG_PC_DOCK = self.powerplug_common.KEY_OUTPUT_3
120
+        # dock
121
+        self.dock_tradfri = pd.get(props.STG_ZGW, loc, roo, props.FUN_DCK)
122
         # desk light
122
         # desk light
123
         self.desk_light_tradfri = pd.get(props.STG_ZGW, loc, roo, props.FUN_DEL)
123
         self.desk_light_tradfri = pd.get(props.STG_ZGW, loc, roo, props.FUN_DEL)
124
         # button
124
         # button
137
         # Button - Brightness functionality
137
         # Button - Brightness functionality
138
         self.brightness_functions = brightness_choose_n_action(self.button_tradfri)
138
         self.brightness_functions = brightness_choose_n_action(self.button_tradfri)
139
         self.brightness_functions.add(self.main_light_tradfri, self.main_light_shelly, self.main_light_shelly.KEY_OUTPUT_0)
139
         self.brightness_functions.add(self.main_light_tradfri, self.main_light_shelly, self.main_light_shelly.KEY_OUTPUT_0)
140
-        self.brightness_functions.add(self.desk_light_tradfri, self.powerplug_common, self.KEY_POWERPLUG_DESK_LIGHT)
140
+        self.brightness_functions.add(self.desk_light_tradfri, self.desk_light_tradfri, self.desk_light_tradfri.KEY_OUTPUT_0)
141
         self.brightness_functions.add(self.remote_amplifier, self.powerplug_common, self.KEY_POWERPLUG_AMPLIFIER)
141
         self.brightness_functions.add(self.remote_amplifier, self.powerplug_common, self.KEY_POWERPLUG_AMPLIFIER)
142
         # Button - Main light
142
         # Button - Main light
143
         self.button_tradfri.add_callback(self.button_tradfri.KEY_ACTION, self.button_tradfri.ACTION_TOGGLE,
143
         self.button_tradfri.add_callback(self.button_tradfri.KEY_ACTION, self.button_tradfri.ACTION_TOGGLE,
144
                                          self.main_light_shelly.toggle_output_0_mcb)
144
                                          self.main_light_shelly.toggle_output_0_mcb)
145
         # Button - Desk light
145
         # Button - Desk light
146
         self.button_tradfri.add_callback(self.button_tradfri.KEY_ACTION, self.button_tradfri.ACTION_RIGHT,
146
         self.button_tradfri.add_callback(self.button_tradfri.KEY_ACTION, self.button_tradfri.ACTION_RIGHT,
147
-                                         self.powerplug_common.toggle_output_1_mcb)
147
+                                         self.desk_light_tradfri.toggle_output_0_mcb)
148
         # Button - Amplifier
148
         # Button - Amplifier
149
         self.button_tradfri.add_callback(self.button_tradfri.KEY_ACTION, self.button_tradfri.ACTION_LEFT_LONG,
149
         self.button_tradfri.add_callback(self.button_tradfri.KEY_ACTION, self.button_tradfri.ACTION_LEFT_LONG,
150
                                          self.powerplug_common.toggle_output_0_mcb)
150
                                          self.powerplug_common.toggle_output_0_mcb)
153
                                          self.powerplug_common.toggle_output_2_mcb)
153
                                          self.powerplug_common.toggle_output_2_mcb)
154
         # Button - PC dock
154
         # Button - PC dock
155
         self.button_tradfri.add_callback(self.button_tradfri.KEY_ACTION, self.button_tradfri.ACTION_LEFT,
155
         self.button_tradfri.add_callback(self.button_tradfri.KEY_ACTION, self.button_tradfri.ACTION_LEFT,
156
-                                         self.powerplug_common.toggle_output_3_mcb)
156
+                                         self.dock_tradfri.toggle_output_0_mcb)
157
 
157
 
158
         # Mediaplayer - Amplifier auto on
158
         # Mediaplayer - Amplifier auto on
159
         self.powerplug_common.add_callback(self.KEY_POWERPLUG_CD_PLAYER, None, self.powerplug_common.set_output_0_mcb, True)
159
         self.powerplug_common.add_callback(self.KEY_POWERPLUG_CD_PLAYER, None, self.powerplug_common.set_output_0_mcb, True)
201
         )
201
         )
202
         self.pc_dock_videv = videv_switching(
202
         self.pc_dock_videv = videv_switching(
203
             mqtt_client, config.TOPIC_GFW_DIRK_PC_DOCK_VIDEV,
203
             mqtt_client, config.TOPIC_GFW_DIRK_PC_DOCK_VIDEV,
204
-            self.powerplug_common, self.KEY_POWERPLUG_PC_DOCK
204
+            self.dock_tradfri, self.dock_tradfri.KEY_OUTPUT_0
205
         )
205
         )
206
         self.heating_function_videv = videv_heating(
206
         self.heating_function_videv = videv_heating(
207
             mqtt_client, config.TOPIC_GFW_DIRK_HEATING_VALVE_VIDEV,
207
             mqtt_client, config.TOPIC_GFW_DIRK_HEATING_VALVE_VIDEV,

Loading…
Cancel
Save