mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-14 09:59:13 -05:00
23 lines
476 B
C#
23 lines
476 B
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace ChrisKaczor.HomeMonitor.DeviceStatus.Service;
|
|
|
|
public class Device
|
|
{
|
|
public Device(string name, string statusString)
|
|
{
|
|
Name = name;
|
|
Update(statusString);
|
|
}
|
|
|
|
[JsonPropertyName("name")]
|
|
public string Name { get; }
|
|
|
|
[JsonPropertyName("status")]
|
|
public bool Status { get; private set; }
|
|
|
|
private void Update(string statusString)
|
|
{
|
|
Status = statusString == "1";
|
|
}
|
|
} |