nixos-configs/devices/homie/modules/home-assistant/netdaemon/apps/AppModel/YamlConfigApp/YamlConfigApp.cs
matt1432 82a05091a5
All checks were successful
Discord / discord commits (push) Has been skipped
feat(hass): setup netdaemon
2024-10-05 12:38:13 -04:00

19 lines
No EOL
494 B
C#

namespace AppModel;
/// <summary>
/// Showcases how to instance apps with yaml and use automatic configuration population
/// </summary>
[NetDaemonApp]
public class HelloYamlApp
{
public HelloYamlApp(IHaContext ha, IAppConfig<HelloConfig> config)
{
ha.CallService("notify", "persistent_notification",
data: new {message = config.Value.HelloMessage, title = "Hello yaml app!"});
}
}
public class HelloConfig
{
public string? HelloMessage { get; set; }
}