feat(netd): standardize version of netdaemon in project
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-10-10 13:11:11 -04:00
parent 81227e34c8
commit 9dda3c5bd2
8 changed files with 51 additions and 48 deletions

View file

@ -0,0 +1 @@
24.37.1

View file

@ -1,7 +1,7 @@
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// Generated using NetDaemon CodeGenerator nd-codegen v24.37.1.0 // Generated using NetDaemon CodeGenerator nd-codegen v24.37.1.0
// At: 2024-10-08T21:14:58.2735702-04:00 // At: 2024-10-10T12:06:21.5284008-04:00
// //
// *** Make sure the version of the codegen tool and your nugets Joysoftware.NetDaemon.* have the same version.*** // *** Make sure the version of the codegen tool and your nugets Joysoftware.NetDaemon.* have the same version.***
// You can use following command to keep it up to date with the latest version: // You can use following command to keep it up to date with the latest version:
@ -379,6 +379,10 @@ public partial class InputBooleanEntities
public InputBooleanEntity NetdaemonSpotifyPlayAlbum => new(_haContext, "input_boolean.netdaemon_spotify_play_album"); public InputBooleanEntity NetdaemonSpotifyPlayAlbum => new(_haContext, "input_boolean.netdaemon_spotify_play_album");
///<summary>netdaemon_spotify_play_artist</summary> ///<summary>netdaemon_spotify_play_artist</summary>
public InputBooleanEntity NetdaemonSpotifyPlayArtist => new(_haContext, "input_boolean.netdaemon_spotify_play_artist"); public InputBooleanEntity NetdaemonSpotifyPlayArtist => new(_haContext, "input_boolean.netdaemon_spotify_play_artist");
///<summary>netdaemon_spotify_play_playlist</summary>
public InputBooleanEntity NetdaemonSpotifyPlayPlaylist => new(_haContext, "input_boolean.netdaemon_spotify_play_playlist");
///<summary>netdaemon_spotify_play_song</summary>
public InputBooleanEntity NetdaemonSpotifyPlaySong => new(_haContext, "input_boolean.netdaemon_spotify_play_song");
} }
public partial class InputTextEntities public partial class InputTextEntities
@ -597,9 +601,9 @@ public partial class SensorEntities
public SensorEntity Pixel8WifiConnection => new(_haContext, "sensor.pixel_8_wifi_connection"); public SensorEntity Pixel8WifiConnection => new(_haContext, "sensor.pixel_8_wifi_connection");
///<summary>Pixel 8 WiFi IP address</summary> ///<summary>Pixel 8 WiFi IP address</summary>
public SensorEntity Pixel8WifiIpAddress => new(_haContext, "sensor.pixel_8_wifi_ip_address"); public SensorEntity Pixel8WifiIpAddress => new(_haContext, "sensor.pixel_8_wifi_ip_address");
///<summary>SM-F741W Battery state</summary> ///<summary>Z Flip 6 Battery state</summary>
public SensorEntity SmF741wBatteryState => new(_haContext, "sensor.sm_f741w_battery_state"); public SensorEntity SmF741wBatteryState => new(_haContext, "sensor.sm_f741w_battery_state");
///<summary>SM-F741W Charger type</summary> ///<summary>Z Flip 6 Charger type</summary>
public SensorEntity SmF741wChargerType => new(_haContext, "sensor.sm_f741w_charger_type"); public SensorEntity SmF741wChargerType => new(_haContext, "sensor.sm_f741w_charger_type");
///<summary>Sun Next dawn</summary> ///<summary>Sun Next dawn</summary>
public SensorEntity SunNextDawn => new(_haContext, "sensor.sun_next_dawn"); public SensorEntity SunNextDawn => new(_haContext, "sensor.sun_next_dawn");
@ -641,7 +645,7 @@ public partial class SensorEntities
public NumericSensorEntity Pixel8WifiLinkSpeed => new(_haContext, "sensor.pixel_8_wifi_link_speed"); public NumericSensorEntity Pixel8WifiLinkSpeed => new(_haContext, "sensor.pixel_8_wifi_link_speed");
///<summary>Pixel 8 WiFi signal strength</summary> ///<summary>Pixel 8 WiFi signal strength</summary>
public NumericSensorEntity Pixel8WifiSignalStrength => new(_haContext, "sensor.pixel_8_wifi_signal_strength"); public NumericSensorEntity Pixel8WifiSignalStrength => new(_haContext, "sensor.pixel_8_wifi_signal_strength");
///<summary>SM-F741W Battery level</summary> ///<summary>Z Flip 6 Battery level</summary>
public NumericSensorEntity SmF741wBatteryLevel => new(_haContext, "sensor.sm_f741w_battery_level"); public NumericSensorEntity SmF741wBatteryLevel => new(_haContext, "sensor.sm_f741w_battery_level");
} }
@ -1518,7 +1522,7 @@ public partial record NumericSensorAttributes
public IReadOnlyList<string>? PairedDevices { get; init; } public IReadOnlyList<string>? PairedDevices { get; init; }
[JsonPropertyName("ip6_addresses")] [JsonPropertyName("ip6_addresses")]
public IReadOnlyList<string>? Ip6Addresses { get; init; } public object? Ip6Addresses { get; init; }
} }
public partial record SttEntity : Entity<SttEntity, EntityState<SttAttributes>, SttAttributes> public partial record SttEntity : Entity<SttEntity, EntityState<SttAttributes>, SttAttributes>
@ -4007,6 +4011,16 @@ public partial class NetdaemonServices
{ {
_haContext.CallService("netdaemon", "spotify_play_artist", null, data); _haContext.CallService("netdaemon", "spotify_play_artist", null, data);
} }
public void SpotifyPlayPlaylist(object? data = null)
{
_haContext.CallService("netdaemon", "spotify_play_playlist", null, data);
}
public void SpotifyPlaySong(object? data = null)
{
_haContext.CallService("netdaemon", "spotify_play_song", null, data);
}
} }
public partial record NetdaemonEntityCreateParameters public partial record NetdaemonEntityCreateParameters

View file

@ -48,7 +48,7 @@ in {
]; ];
text = '' text = ''
# Install codegen # Install codegen
dotnet tool install --create-manifest-if-needed NetDaemon.HassModel.CodeGen dotnet tool install --create-manifest-if-needed NetDaemon.HassModel.CodeGen --version "$(cat ./.version)"
# Run it # Run it
dotnet tool run nd-codegen -token "$(sed 's/HomeAssistant__Token=//' ${secrets.netdaemon.path})" dotnet tool run nd-codegen -token "$(sed 's/HomeAssistant__Token=//' ${secrets.netdaemon.path})"
@ -71,6 +71,9 @@ in {
$(nix build --no-link --print-out-paths --impure --expr "let self = builtins.getFlake (\"$FLAKE\"); inherit (self.nixosConfigurations.homie) pkgs; in (pkgs.callPackage $FLAKE/devices/homie/modules/home-assistant/netdaemon/package.nix {}).fetch-deps") . $(nix build --no-link --print-out-paths --impure --expr "let self = builtins.getFlake (\"$FLAKE\"); inherit (self.nixosConfigurations.homie) pkgs; in (pkgs.callPackage $FLAKE/devices/homie/modules/home-assistant/netdaemon/package.nix {}).fetch-deps") .
alejandra . alejandra .
rm -r "$FLAKE/.config" rm -r "$FLAKE/.config"
sed -i "s/finalImageTag = .*/finalImageTag = \"$(cat ./.version)\";/" ./images/netdaemon.nix
updateImages .
''; '';
}) })
]; ];

View file

@ -6,6 +6,7 @@
<LangVersion>12.0</LangVersion> <LangVersion>12.0</LangVersion>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<RootNamespace>netdaemon</RootNamespace> <RootNamespace>netdaemon</RootNamespace>
<Version>$([System.IO.File]::ReadAllText(".version"))</Version>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>

View file

@ -1,22 +1,26 @@
{ {
lib,
buildDotnetModule, buildDotnetModule,
dotnetCorePackages, dotnetCorePackages,
nix-gitignore,
}: let }: let
inherit (lib) any hasInfix hasSuffix removeSuffix;
srcDirs = ["apps"];
srcPatterns = [".cs" ".csproj" ".json" ".version"];
pname = "netdaemon-config"; pname = "netdaemon-config";
in in
buildDotnetModule { buildDotnetModule {
inherit pname; inherit pname;
version = "0.0.0"; version = removeSuffix "\n" (builtins.readFile ./.version);
src = src = builtins.path {
nix-gitignore.gitignoreSource [ name = "netdaemon-src";
"*.nix" path = ./.;
".direnv" filter = file: type:
".envrc" (type == "directory" && any (s: hasInfix s file) srcDirs)
"images" || any (s: hasSuffix s file) srcPatterns;
] };
./.;
projectFile = "netdaemon.csproj"; projectFile = "netdaemon.csproj";
nugetDeps = ./deps.nix; nugetDeps = ./deps.nix;

View file

@ -4,8 +4,9 @@
pkgs, pkgs,
... ...
}: let }: let
inherit (lib) all any attrValues findSingle length mapAttrs mkIf mkOption types; inherit (lib) mkIf mkOption types;
inherit (builtins) filter hasAttr listToAttrs removeAttrs; inherit (lib.lists) all any filter findSingle length;
inherit (lib.attrsets) attrValues hasAttr listToAttrs mapAttrs removeAttrs;
inherit (config.sops) secrets; inherit (config.sops) secrets;
inherit (config.vars) hostName; inherit (config.vars) hostName;

View file

@ -4,22 +4,11 @@
pkgs, pkgs,
... ...
}: let }: let
inherit inherit (lib) converge getExe mkOption types;
(lib) inherit (lib.modules) mkForce mkIf;
concatMapStringsSep inherit (lib.lists) elem optionals;
converge inherit (lib.strings) concatMapStringsSep optionalString;
elem inherit (lib.attrsets) mapAttrsToList filterAttrsRecursive optionalAttrs;
filterAttrsRecursive
getExe
mapAttrsToList
mkForce
mkIf
mkOption
optionalAttrs
optionals
optionalString
types
;
cfg = config.services.esphome; cfg = config.services.esphome;

View file

@ -4,20 +4,10 @@
pkgs, pkgs,
... ...
}: let }: let
inherit inherit (lib.lists) map;
(lib) inherit (lib.modules) mkForce mkIf mkOverride;
attrNames inherit (lib.strings) concatMapStringsSep concatStringsSep optionalString;
concatMapStringsSep inherit (lib.attrsets) attrNames nameValuePair filterAttrs listToAttrs;
concatStringsSep
filterAttrs
listToAttrs
map
mkForce
mkIf
mkOverride
nameValuePair
optionalString
;
cfg = config.services.wyoming; cfg = config.services.wyoming;
in { in {