cleare unused tojson function

This commit is contained in:
atef 2026-02-27 12:55:39 +01:00
parent d9de727c41
commit b6b1cfccb9
1 changed files with 0 additions and 20 deletions

View File

@ -32,24 +32,4 @@ public record StatusRecord
public required EssControl EssControl { get; set; } // TODO: init only
public required StateMachine StateMachine { get; init; }
public string ToJson()
{
// Try to get the "Battery" property via reflection
// var batteryProperty = thing.GetType().GetProperty("Battery");
// if (batteryProperty == null)
// throw new InvalidOperationException("The object does not have a 'Battery' property.");
//
// // Retrieve the value of the Battery property
// var batteryValue = Battery.GetValue(thing);
var jsonOptions = new JsonSerializerOptions { WriteIndented = true };
// Serialize the Battery property
Console.WriteLine("eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee");
string json = JsonSerializer.Serialize(this.Battery, jsonOptions);
Console.WriteLine(json);
return json;
}
}