コード例 #1
0
ファイル: value.py プロジェクト: Bouhmarc/python-openzwave
    def __init__(self, value_id, network=None, parent=None):
        """
        Initialize value

        :param parent:
        n['valueId'] = {'home_id' : v.GetHomeId(),
            * 'parent_id' : v.GetNodeId(),
            * 'commandClass' : PyManager.COMMAND_CLASS_DESC[v.GetCommandClassId()],
            * 'instance' : v.GetInstance(),
            * 'index' : v.GetIndex(),
            * 'id' : v.GetId(),
            * 'genre' : PyGenres[v.GetGenre()],
            * 'type' : PyValueTypes[v.GetType()],
            * #'value' : value.c_str(),
            * 'value' : getValueFromType(manager,v.GetId()),
            * 'label' : label.c_str(),
            * 'units' : units.c_str(),
            * 'readOnly': manager.IsValueReadOnly(v),
            }

        Cache management :
        We must develop a special mechanism for caching values.
        Values are updated or created by notifications and attached to nodes.

        Cache management in nodes : no cache for values.

        :param value_id: ID of the value
        :type value_id: int
        :param network: The network object to access the manager
        :type network: ZWaveNetwork
        """
        ZWaveObject.__init__(self, value_id, network=network)
        logging.debug("Create object value (valueId:%s)" % (value_id))
        self._parent = parent
コード例 #2
0
ファイル: value.py プロジェクト: Nico0084/python-openzwave
    def __init__(self, value_id, network=None, parent=None):
        """
        Initialize value

        .. code-block:: python

                n['valueId'] = {'home_id' : v.GetHomeId(),
                    * 'parent_id' : v.GetNodeId(),
                    * 'commandClass' : PyManager.COMMAND_CLASS_DESC[v.GetCommandClassId()],
                    * 'instance' : v.GetInstance(),
                    * 'index' : v.GetIndex(),
                    * 'id' : v.GetId(),
                    * 'genre' : PyGenres[v.GetGenre()],
                    * 'type' : PyValueTypes[v.GetType()],
                    * #'value' : value.c_str(),
                    * 'value' : getValueFromType(manager,v.GetId()),
                    * 'label' : label.c_str(),
                    * 'units' : units.c_str(),
                    * 'readOnly': manager.IsValueReadOnly(v),
                    }

        :param value_id: ID of the value
        :type value_id: int
        :param network: The network object to access the manager
        :type network: ZWaveNetwork
        """
        ZWaveObject.__init__(self, value_id, network=network)
        logger.debug(u"Create object value (valueId:%s)", value_id)
        self._parent = parent
コード例 #3
0
    def __init__(self, value_id, network=None, parent=None):
        """
        Initialize value

        .. code-block:: python

                n['valueId'] = {'home_id' : v.GetHomeId(),
                    * 'parent_id' : v.GetNodeId(),
                    * 'commandClass' : PyManager.COMMAND_CLASS_DESC[v.GetCommandClassId()],
                    * 'instance' : v.GetInstance(),
                    * 'index' : v.GetIndex(),
                    * 'id' : v.GetId(),
                    * 'genre' : PyGenres[v.GetGenre()],
                    * 'type' : PyValueTypes[v.GetType()],
                    * #'value' : value.c_str(),
                    * 'value' : getValueFromType(manager,v.GetId()),
                    * 'label' : label.c_str(),
                    * 'units' : units.c_str(),
                    * 'readOnly': manager.IsValueReadOnly(v),
                    }

        :param value_id: ID of the value
        :type value_id: int
        :param network: The network object to access the manager
        :type network: ZWaveNetwork
        """
        ZWaveObject.__init__(self, value_id, network=network)
        logger.debug(u"Create object value (valueId:%s)", value_id)
        self._parent = parent
コード例 #4
0
    def __init__(self, controller_id, network, options=None):
        """
        Initialize controller object

        :param controller_id: The Id of the controller
        :type controller_id: int
        :param network: The network the controller is attached to
        :type network: ZwaveNetwork
        :param options: options of the manager
        :type options: str

        """
        if controller_id is None:
            controller_id = 1
        ZWaveObject.__init__(self, controller_id, network)
        self._node = None
        self._options = options
        self._library_type_name = None
        self._library_version = None
        self._python_library_version = None
        self._timer_statistics = None
        self._interval_statistics = 0.0
        self._ctrl_lock = threading.Lock()
        #~ self._manager_last = None
        self._ctrl_last_state = self.STATE_NORMAL
        self._ctrl_last_stateint = self.INT_NORMAL
        #~ self._ctrl_last_message = ""
        self.STATES_LOCKED = [self.STATE_STARTING, self.STATE_WAITING, self.STATE_SLEEPING, self.STATE_INPROGRESS]
        self.STATES_UNLOCKED = [self.STATE_NORMAL, self.STATE_CANCEL, self.STATE_ERROR, self.STATE_COMPLETED, self.STATE_FAILED, self.STATE_NODEOK, self.STATE_NODEFAILED]
コード例 #5
0
ファイル: scene.py プロジェクト: robintiwari/python-openzwave
    def __init__(self, scene_id, network=None):
        """
        Initialize zwave scene

        :param scene_id: ID of the scene
        :type scene_id: int
        :param network: The network object to access the manager
        :type network: ZWaveNetwork

        """
        ZWaveObject.__init__(self, scene_id, network)
        logger.debug("Create object scene (scene_id:%s)", scene_id)
        self.values = dict()
コード例 #6
0
ファイル: scene.py プロジェクト: jacKlinc/RPi_HEMS
    def __init__(self, scene_id, network):
        """
        Initialize zwave scene

        :param scene_id: ID of the scene
        :type scene_id: int
        :param network: The network object to access the manager
        :type network: ZWaveNetwork

        """
        ZWaveObject.__init__(self, scene_id, network)
        logger.debug(u"Create object scene (scene_id:%s)", scene_id)
        self.values = dict()
コード例 #7
0
    def __init__(self, node_id, network):
        """
        Initialize zwave node

        :param node_id: ID of the node
        :type node_id: int
        :param network: The network object to access the manager
        :type network: ZWaveNetwork

        """
        logger.debug("Create object node (node_id:%s)", node_id)
        ZWaveObject.__init__(self, node_id, network)
        #No cache management for values in nodes
        self.values = dict()
        self._is_locked = False
        self._isReady = False
コード例 #8
0
ファイル: node.py プロジェクト: JshWright/python-openzwave
    def __init__(self, node_id, network):
        """
        Initialize zwave node

        :param node_id: ID of the node
        :type node_id: int
        :param network: The network object to access the manager
        :type network: ZWaveNetwork

        """
        logger.debug("Create object node (node_id:%s)", node_id)
        ZWaveObject.__init__(self, node_id, network)
        #No cache management for values in nodes
        self.values = dict()
        self._is_locked = False
        self._isReady = False
コード例 #9
0
    def __init__(self, group_index, network=None, node_id=None):
        """
        Initialize driver object

        :param group_index: index of the group
        :type group_index: int
        :param network: The network object to access the manager
        :type network: ZWaveNetwork
        :param node_id: ID of node
        :type node_id: int

        """

        ZWaveObject.__init__(self, group_index, network)

        self._node_id = node_id
        self._index = group_index
コード例 #10
0
    def __init__(self, controller_id, network, options=None):
        """
        Initialize controller object

        :param controller_id: The Id of the controller
        :type controller_id: int
        :param network: The network the controller is attached to
        :type network: ZwaveNetwork
        :param options: options of the manager
        :type options: str

        """
        if controller_id is None:
            controller_id = 1
        ZWaveObject.__init__(self, controller_id, network)
        self._node = None
        self._options = options
        self._library_type_name = None
        self._library_version = None
        self._python_library_version = None
コード例 #11
0
ファイル: controller.py プロジェクト: wazoo/python-openzwave
    def __init__(self, controller_id, network, options=None):
        """
        Initialize controller object

        :param controller_id: The Id of the controller
        :type controller_id: int
        :param network: The network the controller is attached to
        :type network: ZwaveNetwork
        :param options: options of the manager
        :type options: str

        """
        if controller_id is None:
            controller_id = 1
        ZWaveObject.__init__(self, controller_id, network)
        self._node = None
        self._options = options
        self._library_type_name = None
        self._library_version = None
        self._python_library_version = None
        self.ctrl_last_state = self.SIGNAL_CTRL_NORMAL
        self.ctrl_last_message = ""
        self._timer_statistics = None
        self._interval_statistics = 0.0
コード例 #12
0
    def __init__(self, controller_id, network, options=None):
        """
        Initialize controller object

        :param controller_id: The Id of the controller
        :type controller_id: int
        :param network: The network the controller is attached to
        :type network: ZwaveNetwork
        :param options: options of the manager
        :type options: str

        """
        if controller_id is None:
            controller_id = 1
        ZWaveObject.__init__(self, controller_id, network)
        self._node = None
        self._options = options
        self._library_type_name = None
        self._library_version = None
        self._python_library_version = None
        self.ctrl_last_state = self.SIGNAL_CTRL_NORMAL
        self.ctrl_last_message = ""
        self._timer_statistics = None
        self._interval_statistics = 0.0