mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-14 09:59:13 -05:00
18 lines
366 B
C#
18 lines
366 B
C#
namespace Service;
|
|
|
|
public class DeviceRepository : Dictionary<string, Device>
|
|
{
|
|
public void HandleDeviceMessage(string name, string value)
|
|
{
|
|
if (ContainsKey(name))
|
|
{
|
|
this[name].Update(value);
|
|
}
|
|
else
|
|
{
|
|
var device = new Device(name, value);
|
|
|
|
this[name] = device;
|
|
}
|
|
}
|
|
} |