|
@@ -4,12 +4,9 @@
|
4
|
4
|
|
5
|
5
|
import config
|
6
|
6
|
import devdi.topic as props
|
7
|
|
-from devices import group
|
8
|
|
-from function.db import get_radiator_data, set_radiator_data
|
9
|
7
|
from function.helpers import day_event
|
10
|
|
-from function.modules import brightness_choose_n_action, timer_on_activation, heating_function
|
11
|
8
|
from function.rooms import room, room_collection
|
12
|
|
-from function.videv import videv_switching, videv_switch_brightness, videv_switching_timer, videv_switch_brightness_color_temp, videv_heating, videv_multistate
|
|
9
|
+from function.videv import videv_switching, videv_pure_switch
|
13
|
10
|
import logging
|
14
|
11
|
|
15
|
12
|
try:
|
|
@@ -46,6 +43,10 @@ class garden_garden(room):
|
46
|
43
|
#
|
47
|
44
|
# Virtual Device Interface
|
48
|
45
|
#
|
|
46
|
+ # mode
|
|
47
|
+ self.mode_videv = videv_pure_switch(
|
|
48
|
+ mqtt_client, config.TOPIC_GAR_GARDEN_MODE_VIDEV
|
|
49
|
+ )
|
49
|
50
|
# garland
|
50
|
51
|
self.garland_videv = videv_switching(
|
51
|
52
|
mqtt_client, config.TOPIC_GAR_GARDEN_GARLAND_VIDEV,
|
|
@@ -53,7 +54,8 @@ class garden_garden(room):
|
53
|
54
|
)
|
54
|
55
|
|
55
|
56
|
def __day_events__(self, device, key, data):
|
56
|
|
- if key in (self.day_events.KEY_SUNSET, self.day_events.KEY_START_OF_DAY):
|
57
|
|
- self.garland_powerplug.set_output_0(True)
|
58
|
|
- elif key in (self.day_events.KEY_START_OF_NIGHT, self.day_events.KEY_SUNRISE):
|
59
|
|
- self.garland_powerplug.set_output_0(False)
|
|
57
|
+ if self.mode_videv.get(self.mode_videv.KEY_STATE):
|
|
58
|
+ if key in (self.day_events.KEY_SUNSET, self.day_events.KEY_START_OF_DAY):
|
|
59
|
+ self.garland_powerplug.set_output_0(True)
|
|
60
|
+ elif key in (self.day_events.KEY_START_OF_NIGHT, self.day_events.KEY_SUNRISE):
|
|
61
|
+ self.garland_powerplug.set_output_0(False)
|