Store in GIT

This commit is contained in:
2026-06-17 15:58:48 +02:00
parent 163db046ef
commit adcacd2cc1
64 changed files with 2249 additions and 0 deletions
+54
View File
@@ -0,0 +1,54 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace HueLights
{
class LightHandler
{
static void Main(string[] args)
{
new LightHandler();
}
private List<Light> lights;
public LightHandler()
{
lights = new List<Light>();
Populate();
RunTest();
}
private void RunTest()
{
Random r = new Random();
TurnOn(lights[r.Next(0, lights.Count)].getID());
Update();
Console.ReadLine();
}
private void Populate()
{
lights.Add(new LightHue(1, 100));
lights.Add(new LightHue(2, 200));
lights.Add(new LigthLux(3, 300));
}
public void TurnOn(int id)
{
lights.ForEach(a => { if (a.getID() == id) { a.setState(true); } });
}
public void Update()
{
lights.ForEach(a => a.Update() );
}
}
}