Browse Source

Fix for get method and get_str method implemented

master
Dirk Alders 1 year ago
parent
commit
7e4f92aaf1
1 changed files with 12 additions and 2 deletions
  1. 12
    2
      devices.py

+ 12
- 2
devices.py View File

74
             loc (numeric): Location (see LOC_* in props)
74
             loc (numeric): Location (see LOC_* in props)
75
             roo (numeric): Room (see ROO_* in props)
75
             roo (numeric): Room (see ROO_* in props)
76
             fun (numeric): Function (see FUN_* in props)
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
         return self[topic]
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
 class physical_devices(base):
93
 class physical_devices(base):
84
     """
94
     """

Loading…
Cancel
Save