protected override void OnControlChangeRequest(ControlChange change) { Context.GetSerilogger().SerlogInfo("OnControlChangeRequest", new Dictionary<string, object> { {"Id", change.Id}, {"ActionName", change.Action.Name} }); }
protected override void OnControlChangeRequest(ControlChange change) { Logger.SerlogInfo("OnControlChangeRequest", new Dictionary<string, object> { {"Id", change.Id}, {"ActionName", change.Action.Name} }); DeviceCommand command; int deviceId; try { command = new CommandBuilder(change.Action).Build(); deviceId = IdConverter.GetDeviceId(change.Id); } catch (ArgumentException ex) { TellPluginPort(new PluginFailure(ex.Message)); return; } TelldusCore.GetDevice(deviceId).SendCommand(command); }
protected void TellPluginPort(ControlChange message) { TellInternal(message); }
private void OnDeviceStateChanged(DeviceStateChangedEventArgs message) { Logger.SerlogInfo("OnDeviceStateChanged", new Dictionary<string, object> { {"Id", message.DeviceId}, {"Method", message.Method}, {"DimLevel", message.DimLevel} }); var action = CreateControlAction(message); var response = new ControlChange(IdConverter.GetDeviceId(message.DeviceId), action); TellPluginPort(response); }
protected abstract void OnControlChangeRequest(ControlChange change);