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); } }
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); } }
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); }
public void AddValueId(ZWValueID valueId) { if (!_valueIds.Any(v => v.GetCommandClassId() == valueId.GetCommandClassId() && v.GetId() == valueId.GetId())) { _valueIds.Add(valueId); } }
//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); }