Selaa lähdekoodia

Fix for get method and get_str method implemented

master
Dirk Alders 1 vuosi sitten
vanhempi
commit
7e4f92aaf1
1 muutettua tiedostoa jossa 12 lisäystä ja 2 poistoa
  1. 12
    2
      devices.py

+ 12
- 2
devices.py Näytä tiedosto

@@ -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…
Peruuta
Tallenna