nixpkgs/pkgs/servers/home-assistant/custom-components
K900 e1c1556767 home-assistant-custom-components.midea_ac_lan: init at 0.3.22
This one works better for me for some reason.
2024-05-17 14:06:45 +03:00
..
adaptive_lighting home-assistant-custom-components.adaptive_lighting: init at 1.19.1 2023-12-07 16:25:26 +01:00
auth-header home-assistant-custom-components.auth-header: init at 1.10-unstable-2024-02-26 2024-03-02 13:22:01 -07:00
better_thermostat home-assistant-custom-components.better_thermostat: 1.5.0-beta7 -> 1.5.0 2024-04-19 08:37:41 -07:00
emporia_vue home-assistant-custom-components.emporia_vue: init at 0.8.3 2024-02-06 19:18:37 -08:00
epex_spot home-assistant0-custom-components.epex_spot: init at v2.3.5 (#296362) 2024-03-16 13:35:24 +01:00
frigate home-assistant-custom-components.frigate: init at 5.1.0 2024-03-20 19:10:31 -07:00
govee-lan home-assistant.custom-components.govee-lan: init at unstable-2023-06-10 2023-12-08 13:13:01 +01:00
gpio home-assistant-custom-components.gpio: 0.0.2 -> 0.0.4 2024-02-12 19:11:22 +01:00
homematicip_local home-assistant-custom-components.homematicip_local: 1.59.0 -> 1.60.1 2024-04-26 17:41:29 -07:00
indego home-assistant-custom-components.indego: init at 5.5.0 2024-04-13 19:08:17 +02:00
local_luftdaten home-assistant-custom-components.local_luftdaten: init at 2.3.1 2024-04-08 20:57:35 +02:00
localtuya home-assistant-custom-components.localtuya: init at 5.2.1 2024-01-31 00:25:24 +01:00
midea_ac_lan home-assistant-custom-components.midea_ac_lan: init at 0.3.22 2024-05-17 14:06:45 +03:00
midea-air-appliances-lan home-assistant-components.midea-air-appliances-lan: 0.9.2 -> 0.9.4 2024-04-13 10:04:50 +03:00
miele home-assistant-custom-components.miele: 0.1.19 -> 2024.3.0 2024-04-20 22:27:02 +02:00
moonraker home-assistant-custom-components.moonraker: 1.1.1 -> 1.2.0 2024-04-07 09:06:25 +03:00
ntfy home-assistant-custom-component.ntfy: 1.0.2 -> 1.1.0-pre.2 2024-05-10 10:14:17 +02:00
omnik_inverter home-assistant custom component omnik_inverter: init at v2.6.4 (#296085) 2024-03-15 15:01:40 +01:00
prometheus_sensor buildHomeAssistantComponent: migrate from pname to owner/domain 2023-12-06 03:55:33 +01:00
sensi home-assistant-custom-components.sensi: 1.3.1 -> 1.3.4 2024-03-21 03:53:58 +00:00
smartir home-assistant-custom-components.smartir: replace disutils with packaging 2024-05-13 23:11:09 +08:00
smartthinq-sensors home-assistant-custom-components.smartthinq-sensors: init at 0.39.0 2024-04-07 16:21:54 +03:00
tuya_local home-assistant-custom-components.tuya_local: init at 2024.5.2 2024-05-13 13:51:10 +08:00
waste_collection_schedule home-assistant-custom-components.waste_collection_schedule: 1.44.0 -> 1.48.0 2024-05-12 21:36:59 +02:00
xiaomi_gateway3 home-assistant-custom-components.xiaomi_gateway3: 4.0.3 -> 4.0.5 2024-05-12 20:48:16 +08:00
xiaomi_miot home-assistant-custom-components.xiaomi_miot: 0.7.17 -> 0.7.18 2024-05-12 20:49:47 +08:00
yassi home-assistant-custom-components.yassi: update license 2024-04-09 08:21:59 +03:00
default.nix home-assistant-custom-components.midea_ac_lan: init at 0.3.22 2024-05-17 14:06:45 +03:00
README.md treewide: Fix all Nix ASTs in all markdown files 2024-03-28 09:28:12 +01:00

Packaging guidelines

buildHomeAssistantComponent

Custom components should be packaged using the buildHomeAssistantComponent function, that is provided at top-level. It builds upon buildPythonPackage but uses a custom install and check phase.

Python runtime dependencies can be directly consumed as unqualified function arguments. Pass them into propagatedBuildInputs, for them to be available to Home Assistant.

Out-of-tree components need to use Python packages from home-assistant.python.pkgs as to not introduce conflicting package versions into the Python environment.

Example Boilerplate:

{ lib
, buildHomeAssistantcomponent
, fetchFromGitHub
}:

buildHomeAssistantComponent {
  # owner, domain, version

  src = fetchFromGithub {
    # owner, repo, rev, hash
  };

  propagatedBuildInputs = [
    # python requirements, as specified in manifest.json
  ];

  meta = with lib; {
    # changelog, description, homepage, license, maintainers
  };
}

Package attribute

The attribute name must reflect the domain as seen in the manifest.json, which in turn will match the python module name below in the custom_components/ directory.

Example:

The project mweinelt/ha-prometheus-sensor would receive the attribute name "prometheus_sensor", because both domain in the manifest.json as well as the module name are prometheus_sensor.

Package name

The pname attribute is a composition of both owner and domain.

Don't set pname, set owner and domain instead.

Exposing the domain attribute separately allows checking for conflicting components at eval time.

Manifest check

The buildHomeAssistantComponent builder uses a hook to check whether the dependencies specified in the manifest.json are present and inside the specified version range. It also makes sure derivation and manifest agree about the domain name.

There shouldn't be a need to disable this hook, but you can set dontCheckManifest to true in the derivation to achieve that.