|
@@ -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)
|