diff --git a/HomeAssistant/HassExtensions.cs b/HomeAssistant/HassExtensions.cs index 80f4b6c..13c71f2 100644 --- a/HomeAssistant/HassExtensions.cs +++ b/HomeAssistant/HassExtensions.cs @@ -1,3 +1,4 @@ +using DisplayUtil.Template; using DisplayUtil.Utils; using NetDaemon.Client.Extensions; using NetDaemon.Client.Settings; @@ -19,7 +20,7 @@ public static IHostApplicationBuilder AddHassSupport(this IHostApplicationBuilde builder.Services .AddHomeAssistantClient() - .AddScoped(); + .AddScoped(); // Hack: Initialize Hass Model var extensionType = typeof(DependencyInjectionSetup); diff --git a/HomeAssistant/HassHostedService.cs b/HomeAssistant/HassHostedService.cs index a11cfe6..66784fc 100644 --- a/HomeAssistant/HassHostedService.cs +++ b/HomeAssistant/HassHostedService.cs @@ -35,8 +35,8 @@ public Task StartAsync(CancellationToken cancellationToken) private async Task OnConnection(IHomeAssistantConnection connection) { - logger.LogInformation("Hass Connection initialized"); await cacheManager.InitializeAsync(_cancellationTokenSource.Token); + logger.LogInformation("Hass Connection initialized"); } public Task StopAsync(CancellationToken cancellationToken) diff --git a/Template/TemplateRenderer.cs b/Template/TemplateRenderer.cs index 75b07c4..edc9eb0 100644 --- a/Template/TemplateRenderer.cs +++ b/Template/TemplateRenderer.cs @@ -14,7 +14,7 @@ public async Task RenderToStreamAsync(string content) { var template = Scriban.Template.Parse(content); var rendered = await template.RenderAsync(contextProvider - .GetTemplateContext()); + .GetTemplateContext(EnrichScope.ScreenRendering)); var memoryStream = new MemoryStream(); memoryStream.Write(Encoding.UTF8.GetBytes(rendered));