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
|
obj
|
||||||
bin
|
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"
|
"ConsoleThemeType": "Ansi"
|
||||||
},
|
},
|
||||||
|
"HomeAssistant": {
|
||||||
|
"Host": "homie.nelim.org",
|
||||||
|
"Port": 443,
|
||||||
|
"Ssl": true
|
||||||
|
},
|
||||||
"NetDaemon": {
|
"NetDaemon": {
|
||||||
"ApplicationConfigurationFolder": "./apps"
|
"ApplicationConfigurationFolder": "./apps"
|
||||||
},
|
},
|
||||||
|
|
|
@ -42,10 +42,17 @@ in {
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
(pkgs.writeShellApplication {
|
(pkgs.writeShellApplication {
|
||||||
name = "updateNuDeps";
|
name = "updateNuDeps";
|
||||||
runtimeInputs = [pkgs.dotnet-sdk_8];
|
runtimeInputs = with pkgs; [
|
||||||
|
dos2unix
|
||||||
|
dotnet-sdk_8
|
||||||
|
];
|
||||||
text = ''
|
text = ''
|
||||||
# Update the codegen
|
# Install codegen
|
||||||
dotnet tool update -g NetDaemon.HassModel.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
|
# Update all nugets to latest versions
|
||||||
regex='PackageReference Include="([^"]*)" Version="([^"]*)"'
|
regex='PackageReference Include="([^"]*)" Version="([^"]*)"'
|
||||||
|
@ -63,6 +70,7 @@ in {
|
||||||
|
|
||||||
${compiled.passthru.fetch-deps} .
|
${compiled.passthru.fetch-deps} .
|
||||||
alejandra .
|
alejandra .
|
||||||
|
rm -r "$FLAKE/.config"
|
||||||
'';
|
'';
|
||||||
})
|
})
|
||||||
];
|
];
|
||||||
|
|
|
@ -4,8 +4,7 @@ using NetDaemon.Extensions.Logging;
|
||||||
using NetDaemon.Extensions.Scheduler;
|
using NetDaemon.Extensions.Scheduler;
|
||||||
using NetDaemon.Extensions.Tts;
|
using NetDaemon.Extensions.Tts;
|
||||||
using NetDaemon.Runtime;
|
using NetDaemon.Runtime;
|
||||||
// Add next line if using code generator
|
using HomeAssistantGenerated;
|
||||||
//using HomeAssistantGenerated;
|
|
||||||
|
|
||||||
#pragma warning disable CA1812
|
#pragma warning disable CA1812
|
||||||
|
|
||||||
|
@ -21,8 +20,7 @@ try
|
||||||
.AddAppsFromAssembly(Assembly.GetExecutingAssembly())
|
.AddAppsFromAssembly(Assembly.GetExecutingAssembly())
|
||||||
.AddNetDaemonStateManager()
|
.AddNetDaemonStateManager()
|
||||||
.AddNetDaemonScheduler()
|
.AddNetDaemonScheduler()
|
||||||
// Add next line if using code generator
|
.AddHomeAssistantGenerated()
|
||||||
// .AddHomeAssistantGenerated()
|
|
||||||
)
|
)
|
||||||
.Build()
|
.Build()
|
||||||
.RunAsync()
|
.RunAsync()
|
||||||
|
|
BIN
flake.lock
BIN
flake.lock
Binary file not shown.
Loading…
Reference in a new issue