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

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

            return result;
        }
Exemplo n.º 5
0
        public static DeviceEvent StillnessDetected(IDevice device, IEventSource source)
        {
            var result = new DeviceEvent(device, new StillnessDetected(), source);

            return result;
        }
Exemplo n.º 6
0
        public static DeviceEvent TemperatureChanged(IDevice device, IEventSource source)
        {
            var result = new DeviceEvent(device, new TemperatureChanged(), source);

            return result;
        }
Exemplo n.º 7
0
        public static DeviceEvent PoweredOn(IDevice device, IEventSource source)
        {
            var result = new DeviceEvent(device, new PoweredOn(), source);

            return result;
        }
Exemplo n.º 8
0
        public static DeviceEvent PowerSensorValueChanged(IDevice device, IEventSource source)
        {
            var result = new DeviceEvent(device, new DevicePowerSensorValueChanged(), source);

            return result;
        }
Exemplo n.º 9
0
        public static DeviceEvent MotionDetected(IDevice device, IEventSource source)
        {
            var result = new DeviceEvent(device, new MotionDetected(), source);

            return result;
        }
Exemplo n.º 10
0
        public static DeviceEvent Lost(IDevice device, IEventSource source)
        {
            var result = new DeviceEvent(device, new DeviceLost(), source);

            return result;
        }
Exemplo n.º 11
0
        public static DeviceEvent KeypadStateChanged(IDevice device, IEventSource source)
        {
            var result = new DeviceEvent(device, new DeviceStateChanged(), source);

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

            return result;
        }