From 03e9fb3803d749d291af8f64fd0c67977ef05446 Mon Sep 17 00:00:00 2001 From: Zhong Jianxin Date: Mon, 18 Nov 2024 20:29:27 +0800 Subject: [PATCH 1/2] home-assistant-custom-components.xiaomi_miot: 0.7.21 -> 0.7.23 Diff: https://github.com/al-one/hass-xiaomi-miot/compare/v0.7.21...v0.7.23 Changelog: https://github.com/al-one/hass-xiaomi-miot/releases/tag/v0.7.23 Fix with home-assistant v2024.11: ``` File "/var/lib/hass/custom_components/xiaomi_miot/__init__.py", line 30, in from homeassistant.config import DATA_CUSTOMIZE ImportError: cannot import name 'DATA_CUSTOMIZE' from 'homeassistant.config' (/nix/store/m1bqz8krvqssm8zq8i456ds5287dfvd9-homeassistant-2024.11.1/lib/python3.12/site-packages/homeassistant/config.py) ``` --- .../custom-components/xiaomi_miot/package.nix | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/pkgs/servers/home-assistant/custom-components/xiaomi_miot/package.nix b/pkgs/servers/home-assistant/custom-components/xiaomi_miot/package.nix index cd6ac2080df3..6934aa251e9f 100644 --- a/pkgs/servers/home-assistant/custom-components/xiaomi_miot/package.nix +++ b/pkgs/servers/home-assistant/custom-components/xiaomi_miot/package.nix @@ -2,9 +2,8 @@ lib, buildHomeAssistantComponent, fetchFromGitHub, - hap-python, + construct, micloud, - pyqrcode, python-miio, nix-update-script, }: @@ -12,19 +11,18 @@ buildHomeAssistantComponent rec { owner = "al-one"; domain = "xiaomi_miot"; - version = "0.7.21"; + version = "0.7.23"; src = fetchFromGitHub { owner = "al-one"; repo = "hass-xiaomi-miot"; rev = "v${version}"; - hash = "sha256-5MYA5MejQAANyjVqhqZtaIEQEs1K/aOx+1n+L9TmNmY="; + hash = "sha256-PTjkKuK+DAOmKREr0AHjFXzy4ktguD4ZOHcWuLedLH0="; }; - propagatedBuildInputs = [ - hap-python + dependencies = [ + construct micloud - pyqrcode python-miio ]; From c4c6f50302096e7957a17b35b05ec9c4c4db6298 Mon Sep 17 00:00:00 2001 From: Zhong Jianxin Date: Tue, 19 Nov 2024 20:31:02 +0800 Subject: [PATCH 2/2] home-assistant-custom-components.xiaomi_miot: add meta.longDescription, remove `with lib` --- .../custom-components/xiaomi_miot/package.nix | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/pkgs/servers/home-assistant/custom-components/xiaomi_miot/package.nix b/pkgs/servers/home-assistant/custom-components/xiaomi_miot/package.nix index 6934aa251e9f..005284c76b6a 100644 --- a/pkgs/servers/home-assistant/custom-components/xiaomi_miot/package.nix +++ b/pkgs/servers/home-assistant/custom-components/xiaomi_miot/package.nix @@ -30,11 +30,24 @@ buildHomeAssistantComponent rec { passthru.updateScript = nix-update-script { }; - meta = with lib; { + meta = { changelog = "https://github.com/al-one/hass-xiaomi-miot/releases/tag/v${version}"; description = "Automatic integrate all Xiaomi devices to HomeAssistant via miot-spec, support Wi-Fi, BLE, ZigBee devices"; + longDescription = '' + Xiaomi Miot For HomeAssistant depends on `ffmpeg` and `homekit`, example how to setup in NixOS `configuration.nix`: + + ``` + { config, lib, pkgs, ... }: + { + services.home-assistant = { + customComponents = [ pkgs.home-assistant-custom-components.xiaomi_miot ]; + extraComponents = [ "ffmpeg" "homekit" ]; + }; + } + ``` + ''; homepage = "https://github.com/al-one/hass-xiaomi-miot"; - maintainers = with maintainers; [ azuwis ]; - license = licenses.asl20; + maintainers = with lib.maintainers; [ azuwis ]; + license = lib.licenses.asl20; }; }