nixpkgs/pkgs/servers/home-assistant/custom-components
Martin Weinelt 3185356912
Merge pull request #326987 from mindstorms6/homeassistant-samsungtvsmart
home-assistant-custom-components.samsungtv-smart: init at 0.13.5
2024-07-14 23:15:18 +02:00
..
adaptive_lighting home-assistant-custom-components.adaptive_lighting: 1.19.1 -> 1.22.0 2024-06-15 22:34:07 +01:00
alarmo home-assistant-custom-components.alarmo: init at 1.10.4 2024-07-14 14:24:58 -04:00
auth-header
awtrix home-assistant-custom-components.awtrix: init at unstable-2024-05-26 2024-06-22 17:28:58 +02:00
better_thermostat
elevenlabs_tts home-assistant-custom-components.elevenlabs_tts: init at 2.3.0 2024-07-14 14:11:13 -04:00
emporia_vue
epex_spot home-assistant-custom-component-epex_spot: 2.3.7 -> 2.3.8 2024-07-01 00:59:03 +02:00
frigate
govee-lan
gpio
homematicip_local home-assistant-custom-components.homematicip_local: 1.62.0 -> 1.63.0 2024-06-07 14:00:42 +02:00
indego
local_luftdaten
localtuya treewide: Remove indefinite article from meta.description 2024-06-09 23:07:45 +02: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
miele treewide: Remove indefinite article from meta.description 2024-06-09 23:07:45 +02:00
moonraker home-assistant-custom-components.moonraker: 1.2.1 -> 1.2.2 2024-07-02 19:53:25 +02: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 treewide: Remove the definite article from meta.description 2024-06-09 23:08:46 +02:00
prometheus_sensor home-assistant-custom-components.prometheus_sensor: 1.0.0 -> 1.1.0 2024-05-20 16:41:56 +02:00
samsungtv-smart home-assistant-custom-components.samsungtv-smart: init at 0.13.5 2024-07-14 14:15:35 -04:00
sensi
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: 0.39.0 -> 0.39.2 2024-06-06 12:40:46 +03:00
spook home-assistant-custom-components.spook: init at 3.0.1 2024-06-23 22:03:37 +02:00
tuya_local home-assistant-custom-components.tuya_local: 2024.5.2 -> 2024.6.0 2024-06-12 23:20:54 +02: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 treewide: Remove ending period from meta.description 2024-06-09 23:04:51 +02:00
yassi treewide: Remove indefinite article from meta.description 2024-06-09 23:07:45 +02:00
default.nix Merge pull request #326987 from mindstorms6/homeassistant-samsungtvsmart 2024-07-14 23:15:18 +02:00
README.md

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.