Kaynağa Gözat

ffe.sleep.bed_light_ma implemented

tags/v1.0.0
Dirk Alders 1 yıl önce
ebeveyn
işleme
95a9010240
2 değiştirilmiş dosya ile 8 ekleme ve 0 silme
  1. 2
    0
      __simulation__/rooms.py
  2. 6
    0
      function/first_floor_east.py

+ 2
- 0
__simulation__/rooms.py Dosyayı Görüntüle

@@ -162,6 +162,8 @@ class ffe_sleep(base):
162 162
         #
163 163
         self.gui_bed_light_di = gui_light(mqtt_client, config.TOPIC_FFE_SLEEP_BED_LIGHT_DI_GUI, True, True, False)
164 164
         self.bed_light_di_zigbee = tradfri_light(mqtt_client, config.TOPIC_FFE_SLEEP_BED_LIGHT_DI_ZIGBEE, True, True, False)
165
+        self.gui_bed_light_ma = gui_light(mqtt_client, config.TOPIC_FFE_SLEEP_BED_LIGHT_MA_GUI, True, False, False)
166
+        self.bed_light_ma_powerplug = silvercrest_powerplug(mqtt_client, config.TOPIC_FFE_SLEEP_BED_LIGHT_MA_POWERPLUG)
165 167
         #
166 168
         self.input_device = tradfri_button(mqtt_client, config.TOPIC_FFE_SLEEP_INPUT_DEVICE)
167 169
         self.led_array = gui_led_array(mqtt_client, config.TOPIC_FFE_SLEEP_DEVICE_CHOOSER_LED)

+ 6
- 0
function/first_floor_east.py Dosyayı Görüntüle

@@ -63,6 +63,8 @@ class first_floor_east_sleep(room_shelly_tradfri_light):
63 63
         # bed light
64 64
         self.bed_light_di_tradfri = devices.tradfri_light(mqtt_client, config.TOPIC_FFE_SLEEP_BED_LIGHT_DI_ZIGBEE)
65 65
         self.gui_bed_light_di = devices.nodered_gui_light(mqtt_client, config.TOPIC_FFE_SLEEP_BED_LIGHT_DI_GUI)
66
+        self.bed_light_ma_powerplug = devices.silvercrest_powerplug(mqtt_client, config.TOPIC_FFE_SLEEP_BED_LIGHT_MA_POWERPLUG)
67
+        self.gui_bed_light_ma = devices.nodered_gui_switch(mqtt_client, config.TOPIC_FFE_SLEEP_BED_LIGHT_MA_GUI)
66 68
         #
67 69
         self.button_tradfri = devices.tradfri_button(mqtt_client, config.TOPIC_FFE_SLEEP_INPUT_DEVICE)
68 70
         # button / brightness function
@@ -80,11 +82,15 @@ class first_floor_east_sleep(room_shelly_tradfri_light):
80 82
                                          self.main_light_shelly.toggle_output_0_mcb)
81 83
         self.button_tradfri.add_callback(devices.tradfri_button.KEY_ACTION, devices.tradfri_button.ACTION_LEFT,
82 84
                                          self.bed_light_di_tradfri.toggle_output_0_mcb)
85
+        self.button_tradfri.add_callback(devices.tradfri_button.KEY_ACTION, devices.tradfri_button.ACTION_LEFT_LONG,
86
+                                         self.bed_light_ma_powerplug.toggle_output_0_mcb)
83 87
 
84 88
         # bed light
85 89
         # switch
86 90
         self.gui_bed_light_di.add_callback(devices.nodered_gui_light.KEY_STATE, None, self.bed_light_di_tradfri.set_output_0_mcb)
87 91
         self.bed_light_di_tradfri.add_callback(devices.tradfri_light.KEY_OUTPUT_0, None, self.gui_bed_light_di.set_state_mcb)
92
+        self.gui_bed_light_ma.add_callback(devices.nodered_gui_switch.KEY_STATE, None, self.bed_light_ma_powerplug.set_output_0_mcb)
93
+        self.bed_light_ma_powerplug.add_callback(devices.silvercrest_powerplug.KEY_OUTPUT_0, None, self.gui_bed_light_ma.set_state_mcb)
88 94
         # brightness and color temperature
89 95
         self.bed_light_di_tradfri.add_callback(devices.tradfri_light.KEY_OUTPUT_0, None, self.gui_bed_light_di.set_enable_mcb)
90 96
         self.gui_bed_light_di.add_callback(devices.nodered_gui_light.KEY_BRIGHTNESS, None, self.bed_light_di_tradfri.set_brightness_mcb)

Loading…
İptal
Kaydet