private Object HandleTurnOffRequest(JObject request) { string DeviceID = (string)request["payload"]["appliance"]["applianceId"]; ErrorLog.Notice("Turning off device {0}\n", DeviceID); Appliance device = DeviceList.GetDevice(DeviceID); ISwitchable switchableDevice = device as ISwitchable; if (switchableDevice != null) { switchableDevice.Off(); } // TODO: return an error if not switchable return(new Response() { Header = new Header() { Namespace = "Alexa.ConnectedHome.Control", Name = DirectiveName.TurnOffConfirmation, PayloadVersion = "2", MessageID = Guid.NewGuid(), }, Payload = new Dictionary <string, string> { }, }); }
public void Undo() { if (_previousState == false) { _target.Off(); } else { _target.On(); } }
static void ISwitchMethod(ISwitchable dev, int x) { if (x == 0) { dev.Off(); dev.ViewState(); } else { dev.On(); dev.ViewState(); } }
public void Dispose() { switchableItem.Off(); }
public void OffButton() { _switchable.Off(); }
public void Execute() { _previousState = _target.GetState(); _target.Off(); }