Browse Source

Warning removed (leftovers in videv)

tags/v1.3.0
Dirk Alders 1 year ago
parent
commit
6e6d27685f
2 changed files with 1 additions and 20 deletions
  1. 1
    5
      function/__init__.py
  2. 0
    15
      function/videv.py

+ 1
- 5
function/__init__.py View File

9
 from function.first_floor_west import first_floor_west
9
 from function.first_floor_west import first_floor_west
10
 from function.first_floor_east import first_floor_east
10
 from function.first_floor_east import first_floor_east
11
 from function.rooms import room_collection
11
 from function.rooms import room_collection
12
-from function.videv import all_off, videv_warnings
12
+from function.videv import all_off
13
 import logging
13
 import logging
14
 
14
 
15
 try:
15
 try:
42
         self.init_cross_room_interactions()
42
         self.init_cross_room_interactions()
43
         # Off Buttons
43
         # Off Buttons
44
         self.init_off_functionality()
44
         self.init_off_functionality()
45
-        # Warnings
46
-        videv_warning = videv_warnings(self.mqtt_client, config.TOPIC_WARNINGS)
47
-        for device in self.all_devices():
48
-            device.add_callback(devices.base.base.KEY_WARNING, None, videv_warning.warningcollector)
49
 
45
 
50
     def init_cross_room_interactions(self):
46
     def init_cross_room_interactions(self):
51
         # shelly dirk input 1
47
         # shelly dirk input 1

+ 0
- 15
function/videv.py View File

137
         self.__tx__(self.KEY_TITLE, data or self.NO_TITLE)
137
         self.__tx__(self.KEY_TITLE, data or self.NO_TITLE)
138
 
138
 
139
 
139
 
140
-class videv_warnings(videv_base):
141
-    MAX_WARNINGS = 10
142
-    KEY_WARNING = 'html_short'
143
-
144
-    def __init__(self, mqtt_client, topic, default_values=None):
145
-        super().__init__(mqtt_client, topic, default_values)
146
-        self.__warnings__ = []
147
-
148
-    def warningcollector(self, client, key, data):
149
-        self.__warnings__.append(data)
150
-        self.__warnings__ = self.__warnings__[-self.MAX_WARNINGS:]
151
-        txt = "<br><br>".join([time.asctime(w[w.KEY_TM]) + "<br>" + w[w.KEY_TEXT] + "<br>" + w[w.KEY_ID] for w in self.__warnings__])
152
-        self.__tx__(self.KEY_WARNING, txt)
153
-
154
-
155
 class all_off(videv_base):
140
 class all_off(videv_base):
156
     ALLOWED_CLASSES = (room, room_collection, )
141
     ALLOWED_CLASSES = (room, room_collection, )
157
 
142
 

Loading…
Cancel
Save