瀏覽代碼

Exception handling for changed dict while loop in videv_base

tags/v1.3.0
Dirk Alders 1 年之前
父節點
當前提交
ce85e1ca27
共有 1 個檔案被更改,包括 6 行新增3 行删除
  1. 6
    3
      base.py

+ 6
- 3
base.py 查看文件

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

Loading…
取消
儲存