Apply code formatting cleanup across monitor projects
- Reindent appsettings.json and the MSBuild project files - Collapse single-statement guard blocks and tidy using and member order - Normalize XML doc indentation and file endings - Reorder BatteryMonitor test-data helpers and move the exclusion tests into their own region - Carry the same formatting through the boiler config, control, entity and test files
This commit is contained in:
@@ -23,9 +23,7 @@ public class EntityManager(
|
||||
public async Task CreateEntityAsync(EntityCreateModel createModel)
|
||||
{
|
||||
if (createModel.EntityId != null)
|
||||
{
|
||||
await entityManager.CreateAsync(createModel.EntityId, createModel.Options, createModel.AdditionalConfig);
|
||||
}
|
||||
}
|
||||
|
||||
public async Task SetEntityState(string entityId, string state)
|
||||
@@ -53,14 +51,12 @@ public class EntityManager(
|
||||
var rootTopic = BuildRootTopic(entityId, mqttConfiguration.Value.DiscoveryPrefix);
|
||||
|
||||
foreach (var suffix in CleanupTopicSuffixes)
|
||||
{
|
||||
haContext.CallService("mqtt", "publish", null, new MqttPublishParameters
|
||||
{
|
||||
Topic = $"{rootTopic}/{suffix}",
|
||||
Payload = string.Empty,
|
||||
Retain = true
|
||||
});
|
||||
}
|
||||
|
||||
// IHaContext.CallService is fire-and-forget; the calls are queued in order on the HA websocket.
|
||||
return Task.CompletedTask;
|
||||
@@ -70,15 +66,13 @@ public class EntityManager(
|
||||
{
|
||||
var separatorIndex = entityId.IndexOf('.');
|
||||
if (separatorIndex <= 0 || separatorIndex == entityId.Length - 1)
|
||||
{
|
||||
throw new ArgumentException(
|
||||
$"Entity id '{entityId}' is not in the 'domain.object_id' format.",
|
||||
nameof(entityId));
|
||||
}
|
||||
|
||||
var domain = entityId[..separatorIndex];
|
||||
var objectId = entityId[(separatorIndex + 1)..];
|
||||
|
||||
return $"{discoveryPrefix}/{domain}/{objectId}";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,18 +7,18 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="NetDaemon.AppModel" Version="26.43.1" />
|
||||
<PackageReference Include="NetDaemon.Extensions.Mqtt" Version="26.43.1" />
|
||||
<PackageReference Include="NetDaemon.Runtime" Version="26.43.1" />
|
||||
<PackageReference Include="NetDaemon.HassModel" Version="26.43.1" />
|
||||
<PackageReference Include="NetDaemon.Client" Version="26.43.1" />
|
||||
<PackageReference Include="NetDaemon.Extensions.Scheduling" Version="26.43.1" />
|
||||
<PackageReference Include="NetDaemon.Extensions.Logging" Version="26.43.1" />
|
||||
<PackageReference Include="NetDaemon.Extensions.Tts" Version="26.43.1" />
|
||||
<PackageReference Include="NetDaemon.AppModel" Version="26.43.1"/>
|
||||
<PackageReference Include="NetDaemon.Extensions.Mqtt" Version="26.43.1"/>
|
||||
<PackageReference Include="NetDaemon.Runtime" Version="26.43.1"/>
|
||||
<PackageReference Include="NetDaemon.HassModel" Version="26.43.1"/>
|
||||
<PackageReference Include="NetDaemon.Client" Version="26.43.1"/>
|
||||
<PackageReference Include="NetDaemon.Extensions.Scheduling" Version="26.43.1"/>
|
||||
<PackageReference Include="NetDaemon.Extensions.Logging" Version="26.43.1"/>
|
||||
<PackageReference Include="NetDaemon.Extensions.Tts" Version="26.43.1"/>
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\HomeAssistant.Models\HomeAssistant.Models.csproj" />
|
||||
<ProjectReference Include="..\NordPool.Models\NordPool.Models.csproj" />
|
||||
<ProjectReference Include="..\HomeAssistant.Models\HomeAssistant.Models.csproj"/>
|
||||
<ProjectReference Include="..\NordPool.Models\NordPool.Models.csproj"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
||||
Reference in New Issue
Block a user