feat(netd): add code generation
All checks were successful
Discord / discord commits (push) Has been skipped
All checks were successful
Discord / discord commits (push) Has been skipped
This commit is contained in:
parent
d311d5de3c
commit
2220fccf7a
6 changed files with 10579 additions and 7 deletions
|
@ -1,2 +1,3 @@
|
|||
obj
|
||||
bin
|
||||
NetDaemonCodegen
|
||||
|
|
10560
devices/homie/modules/home-assistant/netdaemon/HomeAssistantGenerated.cs
Normal file
10560
devices/homie/modules/home-assistant/netdaemon/HomeAssistantGenerated.cs
Normal file
File diff suppressed because it is too large
Load diff
|
@ -6,6 +6,11 @@
|
|||
},
|
||||
"ConsoleThemeType": "Ansi"
|
||||
},
|
||||
"HomeAssistant": {
|
||||
"Host": "homie.nelim.org",
|
||||
"Port": 443,
|
||||
"Ssl": true
|
||||
},
|
||||
"NetDaemon": {
|
||||
"ApplicationConfigurationFolder": "./apps"
|
||||
},
|
||||
|
|
|
@ -42,10 +42,17 @@ in {
|
|||
environment.systemPackages = [
|
||||
(pkgs.writeShellApplication {
|
||||
name = "updateNuDeps";
|
||||
runtimeInputs = [pkgs.dotnet-sdk_8];
|
||||
runtimeInputs = with pkgs; [
|
||||
dos2unix
|
||||
dotnet-sdk_8
|
||||
];
|
||||
text = ''
|
||||
# Update the codegen
|
||||
dotnet tool update -g NetDaemon.HassModel.CodeGen
|
||||
# Install codegen
|
||||
dotnet tool install --create-manifest-if-needed NetDaemon.HassModel.CodeGen
|
||||
|
||||
# Run it
|
||||
dotnet tool run nd-codegen -token "$(sed 's/HomeAssistant__Token=//' ${secrets.netdaemon.path})"
|
||||
dos2unix ./HomeAssistantGenerated.cs
|
||||
|
||||
# Update all nugets to latest versions
|
||||
regex='PackageReference Include="([^"]*)" Version="([^"]*)"'
|
||||
|
@ -63,6 +70,7 @@ in {
|
|||
|
||||
${compiled.passthru.fetch-deps} .
|
||||
alejandra .
|
||||
rm -r "$FLAKE/.config"
|
||||
'';
|
||||
})
|
||||
];
|
||||
|
|
|
@ -4,8 +4,7 @@ using NetDaemon.Extensions.Logging;
|
|||
using NetDaemon.Extensions.Scheduler;
|
||||
using NetDaemon.Extensions.Tts;
|
||||
using NetDaemon.Runtime;
|
||||
// Add next line if using code generator
|
||||
//using HomeAssistantGenerated;
|
||||
using HomeAssistantGenerated;
|
||||
|
||||
#pragma warning disable CA1812
|
||||
|
||||
|
@ -21,8 +20,7 @@ try
|
|||
.AddAppsFromAssembly(Assembly.GetExecutingAssembly())
|
||||
.AddNetDaemonStateManager()
|
||||
.AddNetDaemonScheduler()
|
||||
// Add next line if using code generator
|
||||
// .AddHomeAssistantGenerated()
|
||||
.AddHomeAssistantGenerated()
|
||||
)
|
||||
.Build()
|
||||
.RunAsync()
|
||||
|
|
BIN
flake.lock
BIN
flake.lock
Binary file not shown.
Loading…
Reference in a new issue