Exemplo n.º 1
0
 def update(self, value):
     self._value = str(value)
     notification = Notification( Notification.Type_ValueChanged )
     notification.node_id = self.__node_id
     notification.network_id = self.__network_id
     notification.value_id = self.__id
     from has.manager.manager import Manager
     driver = Manager.get_driver( self.__network_id )
     driver.queue_notification( notification )
Exemplo n.º 2
0
    def set(self, value):
        if( self.is_read_only ):
            logger.debug("Value:set ValueType:%s is read only" % self.value_type)
            return False
        
        from has.manager.manager import Manager
        driver = Manager.get_driver( self.__network_id ) 
        if driver is not None:
            node = driver.get_node_unsafe( self.__node_id )
            if node is not None:
                node.set_value( self, value )
                return True

        return False
Exemplo n.º 3
0
 def get_as_string(self):
     from  has.manager.manager import Manager  # to avoid import loop
     driver = Manager.get_driver( self.__network_id )
     node = driver.get_node_unsafe( self.__node_id )
     result = "{0}{1}".format(self._value, self.__units)
     return result
Exemplo n.º 4
0
Arquivo: node.py Projeto: kstaniek/has
 def driver(self):
     from has.manager.manager import Manager
     driver = Manager.get_driver( self._network_id )
     return driver