Beispiel #1
0
        public static DeviceEvent BinarySensorValueChanged(IDevice device, IEventSource source)
        {
            var type = device.BinarySensor.Type;
            var value = device.BinarySensor.Value;

            switch (type)
            {
                case BinarySensorType.Motion:
                    if (value == true)
                    {
                        return MotionDetected(device, source);
                    }

                    if (value == false)
                    {
                        return StillnessDetected(device, source);
                    }
                    break;
            }

            var result = new DeviceEvent(device, new BinarySensorValueChanged(), source);

            return result;
        }
Beispiel #2
0
        public static DeviceEvent CurrentActionChanged(IDevice device, IEventSource source)
        {
            var result = new DeviceEvent(device, new CurrentActionChanged(), source);

            return result;
        }
Beispiel #3
0
        public static DeviceEvent ColorChanged(IDevice device, IEventSource source)
        {
            //TODO: more specific event type
            var result = new DeviceEvent(device, new DeviceStateChanged(), source);

            return result;
        }
Beispiel #4
0
        public static DeviceEvent ThermostatSetpointsChanged(IDevice device, IEventSource source)
        {
            var result = new DeviceEvent(device, new DeviceStateChanged(), source);

            return result;
        }
Beispiel #5
0
        public static DeviceEvent StillnessDetected(IDevice device, IEventSource source)
        {
            var result = new DeviceEvent(device, new StillnessDetected(), source);

            return result;
        }
Beispiel #6
0
        public static DeviceEvent TemperatureChanged(IDevice device, IEventSource source)
        {
            var result = new DeviceEvent(device, new TemperatureChanged(), source);

            return result;
        }
Beispiel #7
0
        public static DeviceEvent PoweredOn(IDevice device, IEventSource source)
        {
            var result = new DeviceEvent(device, new PoweredOn(), source);

            return result;
        }
Beispiel #8
0
        public static DeviceEvent PowerSensorValueChanged(IDevice device, IEventSource source)
        {
            var result = new DeviceEvent(device, new DevicePowerSensorValueChanged(), source);

            return result;
        }
Beispiel #9
0
        public static DeviceEvent MotionDetected(IDevice device, IEventSource source)
        {
            var result = new DeviceEvent(device, new MotionDetected(), source);

            return result;
        }
Beispiel #10
0
        public static DeviceEvent Lost(IDevice device, IEventSource source)
        {
            var result = new DeviceEvent(device, new DeviceLost(), source);

            return result;
        }
Beispiel #11
0
        public static DeviceEvent KeypadStateChanged(IDevice device, IEventSource source)
        {
            var result = new DeviceEvent(device, new DeviceStateChanged(), source);

            return result;
        }
Beispiel #12
0
        public static DeviceEvent IlluminanceSensorValueChanged(IDevice device, IEventSource source)
        {
            //TODO: more specific event type
            var result = new DeviceEvent(device, new DeviceStateChanged(), source);

            return result;
        }
Beispiel #13
0
        public static DeviceEvent Found(IDevice device, IEventSource source)
        {
            var result = new DeviceEvent(device, new DeviceFound(), source);

            return result;
        }