public RemoteSocketOutputPort(LPD433MHzCodeSequencePair codeSequencePair, LPD433MHzSignalSender sender) { if (codeSequencePair == null) throw new ArgumentNullException(nameof(codeSequencePair)); if (sender == null) throw new ArgumentNullException(nameof(sender)); _codeSequencePair = codeSequencePair; _sender = sender; }
public RemoteSwitchOutputPort(int id, LPD433MHzCodeSequence onCodeSequence, LPD433MHzCodeSequence offCodeSequence, LPD433MHzSignalSender sender) { if (onCodeSequence == null) throw new ArgumentNullException(nameof(onCodeSequence)); if (offCodeSequence == null) throw new ArgumentNullException(nameof(offCodeSequence)); if (sender == null) throw new ArgumentNullException(nameof(sender)); _onCodeSqCodeSequence = onCodeSequence; _offCodeSequence = offCodeSequence; _sender = sender; }
public RemoteSwitchController(LPD433MHzSignalSender sender, IHomeAutomationTimer timer) { if (sender == null) throw new ArgumentNullException(nameof(sender)); if (timer == null) throw new ArgumentNullException(nameof(timer)); _sender = sender; // Ensure that the state of the remote switch is restored if the original remote is used // or the switch has been removed from the socket and plugged in at another place. timer.Every(TimeSpan.FromSeconds(5)).Do(RefreshStates); }
public RemoteSocketOutputPort(LPD433MHzCodeSequencePair codeSequencePair, LPD433MHzSignalSender sender) { if (codeSequencePair == null) { throw new ArgumentNullException(nameof(codeSequencePair)); } if (sender == null) { throw new ArgumentNullException(nameof(sender)); } _codeSequencePair = codeSequencePair; _sender = sender; }
private RemoteSwitchController SetupRemoteSwitchController(I2CHardwareBridge i2CHardwareBridge) { const int LDP433MhzSenderPin = 10; var ldp433MHzSender = new LPD433MHzSignalSender(i2CHardwareBridge, LDP433MhzSenderPin, HttpApiController); var remoteSwitchController = new RemoteSwitchController(ldp433MHzSender, Timer); var brennenstuhlCodes = new BrennenstuhlCodeSequenceProvider(); remoteSwitchController.Register( 0, brennenstuhlCodes.GetSequence(BrennenstuhlSystemCode.AllOn, BrennenstuhlUnitCode.A, RemoteSwitchCommand.TurnOn), brennenstuhlCodes.GetSequence(BrennenstuhlSystemCode.AllOn, BrennenstuhlUnitCode.A, RemoteSwitchCommand.TurnOff)); return remoteSwitchController; }
public RemoteSocketController(LPD433MHzSignalSender sender, ISchedulerService schedulerService) { if (sender == null) { throw new ArgumentNullException(nameof(sender)); } if (schedulerService == null) { throw new ArgumentNullException(nameof(schedulerService)); } _sender = sender; // Ensure that the state of the remote switch is restored if the original remote is used // or the switch has been removed from the socket and plugged in at another place. schedulerService.RegisterSchedule("RCSocketStateSender", TimeSpan.FromSeconds(5), RefreshStates); }
public RemoteSocketController(LPD433MHzSignalSender sender, IHomeAutomationTimer timer) { if (sender == null) { throw new ArgumentNullException(nameof(sender)); } if (timer == null) { throw new ArgumentNullException(nameof(timer)); } _sender = sender; // Ensure that the state of the remote switch is restored if the original remote is used // or the switch has been removed from the socket and plugged in at another place. timer.Every(TimeSpan.FromSeconds(5)).Do(RefreshStates); }
public RemoteSocketOutputPort(int id, LPD433MHzCodeSequence onCodeSequence, LPD433MHzCodeSequence offCodeSequence, LPD433MHzSignalSender sender) { if (onCodeSequence == null) { throw new ArgumentNullException(nameof(onCodeSequence)); } if (offCodeSequence == null) { throw new ArgumentNullException(nameof(offCodeSequence)); } if (sender == null) { throw new ArgumentNullException(nameof(sender)); } _onCodeSqCodeSequence = onCodeSequence; _offCodeSequence = offCodeSequence; _sender = sender; }