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; }
public static DeviceEvent CurrentActionChanged(IDevice device, IEventSource source) { var result = new DeviceEvent(device, new CurrentActionChanged(), source); return result; }
public static DeviceEvent ColorChanged(IDevice device, IEventSource source) { //TODO: more specific event type var result = new DeviceEvent(device, new DeviceStateChanged(), source); return result; }
public static DeviceEvent ThermostatSetpointsChanged(IDevice device, IEventSource source) { var result = new DeviceEvent(device, new DeviceStateChanged(), source); return result; }
public static DeviceEvent StillnessDetected(IDevice device, IEventSource source) { var result = new DeviceEvent(device, new StillnessDetected(), source); return result; }
public static DeviceEvent TemperatureChanged(IDevice device, IEventSource source) { var result = new DeviceEvent(device, new TemperatureChanged(), source); return result; }
public static DeviceEvent PoweredOn(IDevice device, IEventSource source) { var result = new DeviceEvent(device, new PoweredOn(), source); return result; }
public static DeviceEvent PowerSensorValueChanged(IDevice device, IEventSource source) { var result = new DeviceEvent(device, new DevicePowerSensorValueChanged(), source); return result; }
public static DeviceEvent MotionDetected(IDevice device, IEventSource source) { var result = new DeviceEvent(device, new MotionDetected(), source); return result; }
public static DeviceEvent Lost(IDevice device, IEventSource source) { var result = new DeviceEvent(device, new DeviceLost(), source); return result; }
public static DeviceEvent KeypadStateChanged(IDevice device, IEventSource source) { var result = new DeviceEvent(device, new DeviceStateChanged(), source); return result; }
public static DeviceEvent IlluminanceSensorValueChanged(IDevice device, IEventSource source) { //TODO: more specific event type var result = new DeviceEvent(device, new DeviceStateChanged(), source); return result; }
public static DeviceEvent Found(IDevice device, IEventSource source) { var result = new DeviceEvent(device, new DeviceFound(), source); return result; }