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