21 lines
540 B
Python
21 lines
540 B
Python
"""
|
|
class DevConfig(DeviceConfig):
|
|
def __init__(self):
|
|
self.i = 1
|
|
self.d = 1.0
|
|
self.b = True
|
|
self.s = "Test"
|
|
"""
|
|
|
|
|
|
class Dev(DeviceBase):
|
|
def __init__(self, name):
|
|
DeviceBase.__init__(self, name, DeviceConfig({"intval":1, "floatval":1.0, "boolval":True, "strval": "Test"}))
|
|
add_device(Dev("testdev"), True)
|
|
|
|
print testdev.config
|
|
print testdev.config.getValue("intval")
|
|
print testdev.config.getValue("floatval")
|
|
print testdev.config.getValue("boolval")
|
|
print testdev.config.getValue("strval")
|