def __init__(self, device, name, description, value):
        """
        Initialize the object.

        device -- the Device this property belongs to
        name -- name of the property
        description -- description of the property, as a dictionary
        value -- current value of this property
        """
        try:
            Property.__init__(self, device, name, description)

            self.device = device
            self.name = name
            self.description = description
            self.value = value

            self.set_cached_value(value)
            self.device.notify_property_changed(self)
            
            if self.device.adapter.DEBUG:
                print("+ PROPERTY init: " + str(name))
                #print("-device: " + str(device))
                #print("-name: " + str(name))
                #print("-description: " + str(description))
                print("  -value: " + str(value))
        except Exception as ex:
            print("property: could not init. Error: " + str(ex))
예제 #2
0
    def __init__(self, device, name, description, value=None, func_is=None, func_set=None):
        """
        Initialize the object.

        device -- the Device this property belongs to
        name -- name of the property
        description -- description of the property, as a dictionary
        value -- current value of this property

        description e.g. {'type': 'boolean'} or more
        'visible'
        'min'
        'max'
        'type'
        'unit'
        'description'
        'minimum'
        'maximum'
        """
        Property.__init__(self, device, name, description)
        # value to and from device
        self.dev_value = 0
        self.func_is = func_is
        self.func_set = func_set
        if value is not None:
            self.set_value(value)
        logging.info("ConbeeProperty__init__ device.id: %s %s %s %s", device.id, name, description, value)
예제 #3
0
 def __init__(self, device, name, description, value):
     Property.__init__(self, device, name, description)
     self.device = device
     self.name = name
     self.title = name
     self.description = description # dictionary
     self.value = value
     self.set_cached_value(value)
 def __init__(self, device, name, description, value):
     """ Initialize the object """
     Property.__init__(self, device, name, description)
     self.device = device
     self.title = name
     self.name = name
     self.description = description
     self.value = value
     self.set_cached_value(value)
예제 #5
0
 def __init__(self, device, name, description, value):
     """
     Initialize the object.
     device -- the Device this property belongs to
     name -- name of the property
     description -- description of the property, as a dictionary
     value -- current value of this property
     """
     Property.__init__(self, device, name, description)
     self.set_cached_value(value)
    def __init__(self, device, value):
        """
        Initialize the object.

        device -- the Device this property belongs to
        value -- current value of this property
        """
        name = 'on'
        description = {'type': 'boolean'}
        Property.__init__(self, device, name, description)
        self.set_cached_value(value)
예제 #7
0
    def __init__(self, device, name, description, value):

        #print("incoming thing device at property init is: " + str(device))
        Property.__init__(self, device, name, description)

        self.device = device
        self.name = name
        self.title = name
        self.description = description  # dictionary
        self.value = value
        self.set_cached_value(value)
예제 #8
0
 def __init__(self, device, name, description, value, original_thing_id, original_property_id):
     Property.__init__(self, device, name, description)
     
     self.original_thing_id = original_thing_id
     self.original_property_id = original_property_id
     self.device = device
     self.name = name
     self.title = name
     self.description = description # dictionary
     self.value = value
     self.set_cached_value(value)
     self.device.notify_property_changed(self)
    def __init__(self, device, name, description, value):
        Property.__init__(self, device, name, description)

        #print("new property with value: " + str(value))
        self.device = device
        self.name = name
        self.title = name
        self.description = description  # dictionary
        self.value = False
        self.set_cached_value(False)
        self.device.notify_property_changed(self)
        print("privacy manager property initiated")
예제 #10
0
    def __init__(self, device, name, description, values, value, node_id,
                 child_id, main_type, subchild_id):  # subchild_id is V_TYPE
        """
        Initialize the object.

        device -- the Device this property belongs to
        name -- name of the property
        description -- description of the property, as a dictionary
        value -- current value of this property
        """
        #print()

        #print("-device " + str(device))
        #print("-name: " + str(name))
        #print("-description: " + str(description))
        #print("-value: " + str(value))
        try:
            if device.adapter.DEBUG:
                print("Property: initialising")
            Property.__init__(self, device, name, description)

            #self.device = device
            self.node_id = node_id  # These three are used in the set_value function to send a message back to the proper node in the MySensors network.
            self.child_id = child_id
            self.main_type = main_type
            self.subchild_id = subchild_id

            self.device = device
            self.name = name
            self.title = name
            self.description = description
            self.values = values
            self.value = value
            self.set_cached_value(value)
            #self.device.notify_property_changed(self)
            #self.set_cached_value(value)
            #self.value = value #hmm, test
            #self.device = device
            if device.adapter.DEBUG:
                print("property value = " + str(self.value))
            #print("self.device inside property = " + str(self.device))
            #self.device.notify_property_changed(self)
            #print("property init done")

        except Exception as ex:
            print("inside adding property error: " + str(ex))
예제 #11
0
    def __init__(self, device, name, description):
        """
        Initialize the object.

        device -- the Device this property belongs to
        name -- name of the property
        description -- description of the property, as a dictionary

        description e.g. {'type': 'boolean'} or more
        'visible'
        'title', before 'label'
        'type'
        '@type'
        'unit'
        'description'
        'minimum'
        'maximum'
        'enum'
        'readOnly'
        """
        Property.__init__(self, device, name, description)
    def __init__(self, device, name, description):
        """
        Initialize the object.

        device -- the Device this property belongs to
        name -- name of the property
        description -- description of the property, as a dictionary
        value -- current value of this property
        """
        try:
            if device.adapter.DEBUG:
                print("Property: initialising")
            Property.__init__(self, device, name, description)

            self.device = device
            self.name = name
            self.title = name
            self.description = description
            self.value = None

        except Exception as ex:
            print("inside adding property error: " + str(ex))
예제 #13
0
 def __init__(self, device, name, description, value):
     Property.__init__(self, device, name, description)
     self.value = value
예제 #14
0
 def __init__(self, device, name, description):
     Property.__init__(self, device, name, description)
     self.pin = device.pin
     self.ip = device.ip
     self.set_cached_value(True)
예제 #15
0
 def __init__(self, device, name, description, value):
     Property.__init__(self, device, name, description)
     self.set_cached_value(value)