From b47ba67e646789499199e5a3d42e138badd87d9e Mon Sep 17 00:00:00 2001 From: matt1432 Date: Mon, 30 Sep 2024 12:06:05 -0400 Subject: [PATCH] feat(hass): add tuya-local integration --- common/packages.nix | 1 + .../homie/modules/home-assistant/assist.nix | 1 + flake.lock | Bin 52573 -> 53062 bytes flake.nix | Bin 10370 -> 10497 bytes inputs.nix | 4 ++++ legacyPackages/hass-components/default.nix | 1 + .../hass-components/tuya-local/default.nix | 22 ++++++++++++++++++ 7 files changed, 29 insertions(+) create mode 100644 legacyPackages/hass-components/tuya-local/default.nix diff --git a/common/packages.nix b/common/packages.nix index 8141b25f..691b2d21 100644 --- a/common/packages.nix +++ b/common/packages.nix @@ -57,6 +57,7 @@ inputs @ { inherit (pkgs.dig) dnsutils; inherit (pkgs) + arp-scan openssh rsync wget diff --git a/devices/homie/modules/home-assistant/assist.nix b/devices/homie/modules/home-assistant/assist.nix index 19967ce4..c4b169d7 100644 --- a/devices/homie/modules/home-assistant/assist.nix +++ b/devices/homie/modules/home-assistant/assist.nix @@ -15,6 +15,7 @@ inherit (self.legacyPackages.${pkgs.system}.hass-components) extended-ollama-conversation + tuya-local ; }; diff --git a/flake.lock b/flake.lock index 37c3e24e2be88ef086b50cf893873f4616f2807e..eaa607ec508812f7c6efca10010265caf57e2369 100644 GIT binary patch delta 217 zcmcaRi}~0*<_%&?WlBmb6LoX)lM{1vi;I$#tQ3?GBAeNkGRbfu_>(_Q^kp?SFg7)u zyf8^l+t)C~B|FkMwalPA%-17CKRd_6!`L`DwaUFTz^FVm+p-|oATqBqsG_2La-*;W zTXw2$VouKFMn(}NGber&)<`omGBHg{Gf6Q`w6w6WNVYIGG)^{5Oi4{MF)=hWFf~sx aG&eO#HJSV|&=$kNNH_<_%&?H#;r;B)$3Lp->(GVj2m% diff --git a/flake.nix b/flake.nix index b85a2f21c91ee02997b0ee07f7b6a0963bbf45b1..160c1cf9d260db9594073b1ebee82b928cc7d02c 100644 GIT binary patch delta 67 zcmZn)Yz*4apvF~FTA8Sulb@WJGkGDau5xZ-cB*b-PL7f_mjW0Rr55BX*eWO?sZ$hH K-Q1wY!~_5ZEfrA! delta 12 TcmZn+Y6{%YptkwH8WR%$BVq*E diff --git a/inputs.nix b/inputs.nix index f713604b..1203779e 100644 --- a/inputs.nix +++ b/inputs.nix @@ -192,6 +192,10 @@ let owner = "TheNimaj"; repo = "extended_ollama_conversation"; } + { + owner = "make-all"; + repo = "tuya-local"; + } { name = "spotifyplus-src"; owner = "thlucas1"; diff --git a/legacyPackages/hass-components/default.nix b/legacyPackages/hass-components/default.nix index c9ccc817..8c84ece6 100644 --- a/legacyPackages/hass-components/default.nix +++ b/legacyPackages/hass-components/default.nix @@ -19,5 +19,6 @@ pkgs.lib.makeScope pkgs.newScope (hass: let hass.callPackage file (inputs // extraArgs // {}); in { extended-ollama-conversation = buildHassComponent ./extended-ollama-conversation {}; + tuya-local = buildHassComponent ./tuya-local {}; spotifyplus = buildHassComponent ./spotifyplus {python3Packages = spotPython3Packages;}; }) diff --git a/legacyPackages/hass-components/tuya-local/default.nix b/legacyPackages/hass-components/tuya-local/default.nix new file mode 100644 index 00000000..53010744 --- /dev/null +++ b/legacyPackages/hass-components/tuya-local/default.nix @@ -0,0 +1,22 @@ +{ + tuya-local-src, + buildHomeAssistantComponent, + python3Packages, + ... +}: let + inherit (builtins) fromJSON readFile; + + manifest = fromJSON (readFile "${tuya-local-src}/custom_components/tuya_local/manifest.json"); +in + buildHomeAssistantComponent { + owner = "make-all"; + + inherit (manifest) domain version; + + src = tuya-local-src; + + propagatedBuildInputs = with python3Packages; [ + tinytuya + tuya-device-sharing-sdk + ]; + }