nixos-configs/devices/homie/modules/home-assistant/netdaemon/apps/AppModel/YamlConfigApp/YamlConfigApp.cs

19 lines
494 B
C#
Raw Normal View History

2024-10-05 12:38:13 -04:00
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; }
}