Parcourir la source

Exception handling for changed dict while loop in videv_base

tags/v1.3.0
Dirk Alders il y a 1 an
Parent
révision
ce85e1ca27
1 fichiers modifiés avec 6 ajouts et 3 suppressions
  1. 6
    3
      base.py

+ 6
- 3
base.py Voir le fichier

@@ -65,9 +65,12 @@ class videv_base(mqtt_base):
65 65
         self.__periodic__.run()
66 66
 
67 67
     def send_all(self, rt):
68
-        for key in self:
69
-            if self[key] is not None:
70
-                self.__tx__(key, self[key])
68
+        try:
69
+            for key in self:
70
+                if self[key] is not None:
71
+                    self.__tx__(key, self[key])
72
+        except RuntimeError:
73
+            self.logger.warning("Runtimeerror while sending cyclic videv information. This may happen on startup.")
71 74
 
72 75
     def add_display(self, my_key, ext_device, ext_key, on_change_only=True):
73 76
         """

Chargement…
Annuler
Enregistrer