mirror of
https://github.com/ckaczor/HomeMonitor.git
synced 2026-01-15 17:23:17 -05:00
Upgrade DeviceStatus service to .NET 8 and add OpenTelemetry
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
using System.Text.Json.Serialization;
|
||||
|
||||
namespace Service;
|
||||
namespace ChrisKaczor.HomeMonitor.DeviceStatus.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)
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; }
|
||||
|
||||
[JsonPropertyName("status")]
|
||||
public bool Status { get; private set; }
|
||||
|
||||
private void Update(string statusString)
|
||||
{
|
||||
Status = statusString == "1";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user