Пример #1
0
        public void DisablePoll(byte NodeID, String ValueLabel)
        {
            ZWValueID id = GetValueID(m_nodeList[3], ValueLabel);

            if (id != null)
            {
                Log("Message", "Enabled poll on " + id.GetId().ToString());
                m_manager.EnablePoll(id);
            }
        }
Пример #2
0
        public void SetValue(ZWValueID valueID)
        {
            int valueIndex = -1;

            for (int index = 0; index < m_values.Count; index++)
            {
                if (m_values[index].GetId() == valueID.GetId())
                {
                    valueIndex = index;
                    break;
                }
            }

            if (valueIndex >= 0)
            {
                m_values[valueIndex] = valueID;
            }
            else
            {
                AddValue(valueID);
            }
        }
Пример #3
0
        private ZWaveSwitch GetZWaveSwitch(ZWValueID value, Node node)
        {
            bool switchValue;
            var  successfullyReadValue = _manager.GetValueAsBool(value, out switchValue);
            var  zWaveSwitch           = new ZWaveSwitch(new ZWaveValueIdentity(node.HomeId, node.NodeId, value.GetId()));

            if (successfullyReadValue)
            {
                zWaveSwitch.SwitchState = switchValue ? SwitchState.On : SwitchState.Off;
            }
            else
            {
                zWaveSwitch.SwitchState = SwitchState.Unknown;
            }
            return(zWaveSwitch);
        }
Пример #4
0
        public void SetValue(ZWValueID valueID)
        {
            int valueIndex = -1;

            for (int index = 0; index < m_values.Count; index++)
            {
                if (m_values[index].GetId() == valueID.GetId())
                {
                    valueIndex = index;
                    break;
                }
            }

            if (valueIndex >= 0)
            {
                m_values[valueIndex] = valueID;
            }
            else
            {
                AddValue(valueID);
            }
        }
Пример #5
0
 public void AddValueId(ZWValueID valueId)
 {
     if (!_valueIds.Any(v => v.GetCommandClassId() == valueId.GetCommandClassId() && v.GetId() == valueId.GetId()))
     {
         _valueIds.Add(valueId);
     }
 }
Пример #6
0
        //private readonly ZWValueID _valueId;
        //private readonly ZWManager _manager;
        public ZWaveValueProperties(ZWValueID valueId, ZWManager manager)
        {
            //_manager = manager;
            //_valueId = valueId;

            _commandClassId = (Enums.CommandClass) valueId.GetCommandClassId();
            _genre = valueId.GetGenre();
            _value = valueId.GetValue(manager);
            _help = manager.GetValueHelp(valueId);
            _pollingEnabled = manager.IsValuePolled(valueId);
            _homeId = valueId.GetHomeId();
            _id = valueId.GetId();
            _index = valueId.GetIndex();
            _instance = valueId.GetInstance();
            _label = manager.GetValueLabel(valueId);
            _nodeId = valueId.GetNodeId();
            _type = valueId.GetType();
            _units = manager.GetValueUnits(valueId);
        }