예제 #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;
        }
예제 #2
0
        public static DeviceEvent CurrentActionChanged(IDevice device, IEventSource source)
        {
            var result = new DeviceEvent(device, new CurrentActionChanged(), source);

            return result;
        }
예제 #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;
        }
예제 #4
0
        public static DeviceEvent ThermostatSetpointsChanged(IDevice device, IEventSource source)
        {
            var result = new DeviceEvent(device, new DeviceStateChanged(), source);

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

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

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

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

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

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

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

            return result;
        }
예제 #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;
        }
예제 #13
0
        public static DeviceEvent Found(IDevice device, IEventSource source)
        {
            var result = new DeviceEvent(device, new DeviceFound(), source);

            return result;
        }