nixpkgs/pkgs/servers/home-assistant/custom-components
2024-09-26 14:36:55 +02:00
..
adaptive_lighting
alarmo
auth-header
average home-assistant-custom-components.average: init at 2.3.4 2024-09-13 13:46:49 +02:00
awtrix
better_thermostat home-assistant-custom-components.better_thermostat: 1.5.0 -> 1.6.0 2024-08-25 20:11:12 -07:00
bodymiscale home-assistant-custom-components.bodymiscale: init at 2024.6.0 2024-09-25 14:51:19 +03:00
dwd home-assistant-custom-components.dwd: add emilylange as maintainer 2024-09-16 23:56:25 +02:00
elevenlabs_tts
emporia_vue
epex_spot
frigate
garmin_connect home-assistant-custom-components.garmin_connect: Add dmadisetti as maintainer 2024-09-05 12:54:38 +02:00
govee-lan treewide: replace all pytest-cov patching outside of pythonPackages with pytest-cov-stub 2024-08-27 20:47:13 +02:00
gpio
homematicip_local home-assistant-custom-components.homematicip_local: 1.64.0 -> 1.65.0 2024-08-26 10:49:54 -07:00
indego
local_luftdaten
localtuya home-assistant-custom-components.localtuya: 5.2.1 -> 5.2.2 2024-08-28 19:00:08 +02:00
mass treewide: replace all pytest-cov patching outside of pythonPackages with pytest-cov-stub (#336777) 2024-08-28 22:17:38 -04:00
midea_ac home-assistant-custom-components.midea_ac: init at 2024.9.2 2024-09-14 16:46:14 +02:00
midea_ac_lan
midea-air-appliances-lan
miele
moonraker home-assistant-custom-components.moonraker: 1.3.4 -> 1.3.5 2024-09-08 11:20:39 +02:00
ntfy
omnik_inverter
prometheus_sensor
samsungtv-smart
sensi
smartir
smartthinq-sensors
solax_modbus home-assistant-custom-components.solax_modbus: 2024.09.4 -> 2024.09.5 2024-09-25 14:47:07 +02:00
solis-sensor home-assistant-custom-components.solis-sensor: 3.6.0 -> 3.7.0 2024-09-06 18:31:36 +01:00
somweb
spook
tuya_local home-assistant-custom-components.tuya_local: 2024.6.0 -> 2024.8.0 2024-09-03 21:15:31 +02:00
volkswagen_we_connect_id
volkswagencarnet
waste_collection_schedule home-assistant-custom-components.waste_collection_schedule: 2.1.0 -> 2.2.0 2024-09-10 12:31:06 -07:00
xiaomi_gateway3 home-assistant-custom-components.xiaomi_gateway3: 4.0.5 -> 4.0.6 2024-09-05 18:30:22 +08:00
xiaomi_miot home-assistant-custom-components.xiaomi_miot: 0.7.19 -> 0.7.20 2024-08-23 04:55:01 +00:00
yassi
default.nix home-assistant-custom-components.bodymiscale: init at 2024.6.0 (#341368) 2024-09-26 14:36:55 +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.