Преглед на файлове

Fix for get method and get_str method implemented

master
Dirk Alders преди 1 година
родител
ревизия
7e4f92aaf1
променени са 1 файла, в които са добавени 12 реда и са изтрити 2 реда
  1. 12
    2
      devices.py

+ 12
- 2
devices.py Целия файл

@@ -74,11 +74,21 @@ class base(dict):
74 74
             loc (numeric): Location (see LOC_* in props)
75 75
             roo (numeric): Room (see ROO_* in props)
76 76
             fun (numeric): Function (see FUN_* in props)
77
-            num (numeric): Device number in case of multiple devices
78 77
         """
79
-        topic = self.__topic__(stg, loc, roo, fun)
78
+        topic = topic_by_props(stg, loc, roo, fun)
80 79
         return self[topic]
81 80
 
81
+    def get_str(self, stg, loc, roo, fun):
82
+        """Method to get a device by str version of props
83
+
84
+        Args:
85
+            stg (str): Source transmittion group (see SIS_* in props)
86
+            loc (str): Location (see LOC_* in props)
87
+            roo (str): Room (see ROO_* in props)
88
+            fun (str): Function (see FUN_* in props)
89
+        """
90
+        return self.get(getattr(props, stg), getattr(props, loc), getattr(props, roo), getattr(props, fun))
91
+
82 92
 
83 93
 class physical_devices(base):
84 94
     """

Loading…
Отказ
Запис