Fix for get method and get_str method implemented
This commit is contained in:
parent
05f0f26141
commit
7e4f92aaf1
14
devices.py
14
devices.py
@ -74,11 +74,21 @@ class base(dict):
|
|||||||
loc (numeric): Location (see LOC_* in props)
|
loc (numeric): Location (see LOC_* in props)
|
||||||
roo (numeric): Room (see ROO_* in props)
|
roo (numeric): Room (see ROO_* in props)
|
||||||
fun (numeric): Function (see FUN_* 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]
|
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):
|
class physical_devices(base):
|
||||||
"""
|
"""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user