feat: migrate boiler control implementation to BoilerMonitor namespace and add budget handling logic
This commit is contained in:
@@ -40,9 +40,20 @@ public class PowerSensorDiscoveryServiceTests
|
||||
foreach (var (entityId, deviceClass, unit, friendlyName) in entities)
|
||||
{
|
||||
var attributes = new Dictionary<string, object?>();
|
||||
if (deviceClass is not null) attributes["device_class"] = deviceClass;
|
||||
if (unit is not null) attributes["unit_of_measurement"] = unit;
|
||||
if (friendlyName is not null) attributes["friendly_name"] = friendlyName;
|
||||
if (deviceClass is not null)
|
||||
{
|
||||
attributes["device_class"] = deviceClass;
|
||||
}
|
||||
|
||||
if (unit is not null)
|
||||
{
|
||||
attributes["unit_of_measurement"] = unit;
|
||||
}
|
||||
|
||||
if (friendlyName is not null)
|
||||
{
|
||||
attributes["friendly_name"] = friendlyName;
|
||||
}
|
||||
|
||||
var attributesJson = JsonSerializer.SerializeToElement(attributes);
|
||||
var entityState = new EntityState { AttributesJson = attributesJson };
|
||||
|
||||
Reference in New Issue
Block a user