Files
HA.NetDeamon/NetDaemonApps/NetDaemonApps/DeviceLib/SilverCrest/SwitchedSocket.cs
Stephan Maier b9eb4cf019 Neuerstellung
2023-08-29 11:37:30 +02:00

38 lines
973 B
C#

using NetDaemonInterface;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Threading;
using System.Threading.Tasks;
namespace NetDaemonApps.DeviceLib.UseeLink
{
public class SwitchedSocket : SocketBase
{
private BackgroundWorker worker;
public SwitchedSocket()
{
worker = new BackgroundWorker();
worker.DoWork += Worker_DoWork;
}
private int SwitchOnDelayTime
{
get { throw new NotImplementedException(); }
set { throw new NotImplementedException(); }
}
private void Worker_DoWork(object? sender, DoWorkEventArgs e)
{
Thread.Sleep(SwitchOffTime);
Outputs.ForEach(x => x.TurnOff());
}
/// <summary>
/// Steckdose nach Zeit x ms ausschalten.
/// </summary>
public int SwitchOffTime { get; set; } = 250;
}
}