diff --git a/devices.py b/devices.py index d1d3b40..f5f73f3 100644 --- a/devices.py +++ b/devices.py @@ -74,11 +74,21 @@ class base(dict): loc (numeric): Location (see LOC_* in props) roo (numeric): Room (see ROO_* in props) fun (numeric): Function (see FUN_* in props) - num (numeric): Device number in case of multiple devices """ - topic = self.__topic__(stg, loc, roo, fun) + topic = topic_by_props(stg, loc, roo, fun) return self[topic] + def get_str(self, stg, loc, roo, fun): + """Method to get a device by str version of props + + Args: + stg (str): Source transmittion group (see SIS_* in props) + loc (str): Location (see LOC_* in props) + roo (str): Room (see ROO_* in props) + fun (str): Function (see FUN_* in props) + """ + return self.get(getattr(props, stg), getattr(props, loc), getattr(props, roo), getattr(props, fun)) + class physical_devices(base): """