소스 검색

Warning removed (leftovers in videv)

tags/v1.3.0
Dirk Alders 1 년 전
부모
커밋
6e6d27685f
2개의 변경된 파일1개의 추가작업 그리고 20개의 파일을 삭제
  1. 1
    5
      function/__init__.py
  2. 0
    15
      function/videv.py

+ 1
- 5
function/__init__.py 파일 보기

@@ -9,7 +9,7 @@ from function.ground_floor_west import ground_floor_west
9 9
 from function.first_floor_west import first_floor_west
10 10
 from function.first_floor_east import first_floor_east
11 11
 from function.rooms import room_collection
12
-from function.videv import all_off, videv_warnings
12
+from function.videv import all_off
13 13
 import logging
14 14
 
15 15
 try:
@@ -42,10 +42,6 @@ class all_functions(room_collection):
42 42
         self.init_cross_room_interactions()
43 43
         # Off Buttons
44 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 46
     def init_cross_room_interactions(self):
51 47
         # shelly dirk input 1

+ 0
- 15
function/videv.py 파일 보기

@@ -137,21 +137,6 @@ class videv_audio_player(videv_base):
137 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 140
 class all_off(videv_base):
156 141
     ALLOWED_CLASSES = (room, room_collection, )
157 142
 

Loading…
취소
저장