Example #1
0
        internal bool ProcessValueUpdate(OpenZWaveDeviceValue value, ValueUpdateType updateType)
        {
            var result = _dataEntry.ProcessValueUpdate(value, updateType);

            if (result)
            {
                _device.UpdateCurrentAction();
            }

            return(result);
        }
Example #2
0
        internal bool ProcessValueUpdate(OpenZWaveDeviceValue value, ValueUpdateType updateType)
        {
            var result = _dataEntry.ProcessValueUpdate(value, updateType);

            if (result)
            {
                _device.UpdateCurrentAction();
            }

            return result;
        }
Example #3
0
        public bool ProcessValueUpdate(OpenZWaveDeviceValue value, ValueUpdateType updateType)
        {
            if (_mode.ProcessValueUpdate(value, updateType))
            {
                return(true);
            }

            if (_currentAction.ProcessValueUpdate(value, updateType))
            {
                return(true);
            }

            return(false);
        }
Example #4
0
        public bool ProcessValueUpdate(OpenZWaveDeviceValue value, ValueUpdateType updateType)
        {
            if (_mode.ProcessValueUpdate(value, updateType))
            {
                return true;
            }

            if (_currentAction.ProcessValueUpdate(value, updateType))
            {
                return true;
            }

            return false;
        }
Example #5
0
        public bool ProcessValueUpdate(OpenZWaveDeviceValue value, ValueUpdateType updateType)
        {
            var availableSetpoints = _setpoints.Values.Where(x => x.HasValue()).ToArray();

            foreach (var setpoint in availableSetpoints)
            {
                if (setpoint.ProcessValueUpdate(value, updateType))
                {
                    return(true);
                }
            }

            return(false);
        }
Example #6
0
        public static string FormatData(this OpenZWaveDeviceValue value)
        {
            var result = new StringBuilder();

            result.AppendLine("CC   : " + FormatCommandClass(value.CommandClass));
            result.AppendLine("Type : " + value.Type);
            result.AppendLine("Index: " + value.Index);
            result.AppendLine("Inst : " + value.Instance);
            result.AppendLine("Value: " + value.GetValue());
            result.AppendLine("Label: " + value.Label);
            result.AppendLine("Help : " + value.Help);
            result.AppendLine("Units: " + value.Units);

            return(result.ToString());
        }
Example #7
0
        internal bool ProcessValueUpdate(OpenZWaveDeviceValue value, ValueUpdateType updateType)
        {
            if (_toggleSwitch.ProcessValueUpdate(value, updateType))
            {
                return(true);
            }

            if (_dimmerSwitch.ProcessValueUpdate(value, updateType))
            {
                return(true);
            }

            if (_binarySensor.ProcessValueUpdate(value, updateType))
            {
                return(true);
            }

            if (_powerSensor.ProcessValueUpdate(value, updateType))
            {
                return(true);
            }

            if (_humiditySensor.ProcessValueUpdate(value, updateType))
            {
                return(true);
            }

            if (_illuminanceSensor.ProcessValueUpdate(value, updateType))
            {
                return(true);
            }

            if (_temperatureSensor.ProcessValueUpdate(value, updateType))
            {
                return(true);
            }

            if (_thermostat.ProcessValueUpdate(value, updateType))
            {
                return(true);
            }

            return(false);
        }
Example #8
0
        public static string GetValue(this OpenZWaveDeviceValue value)
        {
            switch (value.Type)
            {
            case ZWValueID.ValueType.Bool:
                return(value.BooleanValue.ToString());

            case ZWValueID.ValueType.Byte:
                return(value.ByteValue.ToString());

            case ZWValueID.ValueType.Decimal:
                return(value.DecimalValue.ToString());

            case ZWValueID.ValueType.Int:
                return(value.IntValue.ToString());

            case ZWValueID.ValueType.List:
                var selection = value.Selection;
                var list      = (value.ListItemsValue ?? new string[0])
                                .Select(x =>
                {
                    if (string.Equals(x, selection))
                    {
                        return("*" + x + "*");
                    }

                    return(x);
                });

                return("{" + string.Join("/", list) + "}");

            case ZWValueID.ValueType.Schedule:
                return("Schedule");

            case ZWValueID.ValueType.Short:
                return(value.ShortValue.ToString());

            case ZWValueID.ValueType.String:
                return(value.StringValue);

            default:
                return("");
            }
        }
Example #9
0
        public bool ProcessValueUpdate(OpenZWaveDeviceValue value, ValueUpdateType updateType)
        {
            if (_core.ProcessValueUpdate(value, updateType))
            {
                return(true);
            }

            if (_fan.ProcessValueUpdate(value, updateType))
            {
                return(true);
            }

            if (_setpoints.ProcessValueUpdate(value, updateType))
            {
                return(true);
            }

            return(false);
        }
Example #10
0
        internal bool ProcessValueUpdate(OpenZWaveDeviceValue value, ValueUpdateType updateType)
        {
            var result = _dataEntry.ProcessValueUpdate(value, updateType);

            return result;
        }
 private void HandleDeviceValueUpdated(OpenZWaveDevice device, OpenZWaveDeviceValue value, ValueUpdateType updateType)
 {
     HandleDeviceConnected(device, true);
     device.ProcessValueUpdate(value, updateType);
 }
Example #12
0
        public bool ProcessValueUpdate(OpenZWaveDeviceValue value, ValueUpdateType updateType)
        {
            if (_core.ProcessValueUpdate(value, updateType))
            {
                return true;
            }

            if (_fan.ProcessValueUpdate(value, updateType))
            {
                return true;
            }

            if (_setpoints.ProcessValueUpdate(value, updateType))
            {
                return true;
            }

            return false;
        }
        public bool ProcessValueUpdate(OpenZWaveDeviceValue value, ValueUpdateType updateType)
        {
            var availableSetpoints = _setpoints.Values.Where(x => x.HasValue()).ToArray();

            foreach (var setpoint in availableSetpoints)
            {
                if (setpoint.ProcessValueUpdate(value, updateType))
                {
                    return true;
                }
            }

            return false;
        }
Example #14
0
        internal bool ProcessValueUpdate(OpenZWaveDeviceValue value, ValueUpdateType updateType)
        {
            var result = _dataEntry.ProcessValueUpdate(value, updateType);

            return(result);
        }
Example #15
0
        internal bool ProcessValueUpdate(OpenZWaveDeviceValue value, ValueUpdateType updateType)
        {
            if (_toggleSwitch.ProcessValueUpdate(value, updateType))
            {
                return true;
            }

            if (_dimmerSwitch.ProcessValueUpdate(value, updateType))
            {
                return true;
            }

            if (_binarySensor.ProcessValueUpdate(value, updateType))
            {
                return true;
            }

            if (_powerSensor.ProcessValueUpdate(value, updateType))
            {
                return true;
            }

            if (_humiditySensor.ProcessValueUpdate(value, updateType))
            {
                return true;
            }

            if (_illuminanceSensor.ProcessValueUpdate(value, updateType))
            {
                return true;
            }

            if (_temperatureSensor.ProcessValueUpdate(value, updateType))
            {
                return true;
            }

            if (_thermostat.ProcessValueUpdate(value, updateType))
            {
                return true;
            }

            return false;
        }
 private void HandleDeviceValueUpdated(OpenZWaveDevice device, OpenZWaveDeviceValue value, ValueUpdateType updateType)
 {
     HandleDeviceConnected(device, true);
     device.ProcessValueUpdate(value, updateType);
 }