nixpkgs/pkgs/servers/home-assistant/custom-components
2024-12-09 15:41:37 +01:00
..
adaptive_lighting
alarmo
auth-header
average
awtrix
better_thermostat home-assistant-custom-components.better_thermostat: 1.6.0 -> 1.6.1 2024-11-10 17:51:15 +01:00
bodymiscale
climate_group home-assistant-custom-components.climate_group: init at 1.0.7 2024-10-30 09:37:57 -07:00
dirigera_platform home-assistant-custom-lovelace-modules.dirigera_platform: init at 2.6.4 (#350542) 2024-11-10 18:24:41 +01:00
dwd
elevenlabs_tts
emporia_vue
epex_spot home-assistant-custom-component.epex_spot: 2.3.8 -> 2.3.9 (#358394) 2024-11-23 14:30:00 +01:00
frigate
garmin_connect
govee-lan
gpio
homematicip_local home-assistant-custom-components.homematicip_local: 1.72.0 -> 1.73.0 2024-12-06 14:52:42 -08:00
indego
local_luftdaten
localtuya
mass
midea_ac
midea_ac_lan home-assistant-custom-components.midea_ac_lan: add missed dependency (#353216) 2024-11-02 22:03:35 +01:00
midea-air-appliances-lan
miele home-assistant-custom-components.miele: 2024.8.1 -> 2024.11.1 2024-12-09 15:41:37 +01:00
moonraker home-assistant-custom-components.moonraker: 1.3.7 -> 1.4.0 2024-11-09 22:45:33 +01:00
nest_protect
ntfy
omnik_inverter
prometheus_sensor home-assistant-custom-components.prometheus_sensor: 1.1.0 -> 1.1.2 2024-11-05 04:27:35 +01:00
samsungtv-smart
sensi
smartir
smartthinq-sensors
solax_modbus home-assistant-custom-components.solax_modbus: 2024.11.1 -> 2024.11.2 2024-11-25 12:49:20 +01:00
solis-sensor home-assistant-custom-components.solis-sensor: 3.7.1 -> 3.7.2 2024-12-06 14:52:31 +00:00
somweb
spook
systemair home-assistant-custom-components.systemair: init at 0.2.0 2024-11-12 21:34:58 +01:00
tuya_local
volkswagen_we_connect_id
volkswagencarnet
waste_collection_schedule home-assistant-custom-components.waste_collection_schedule: 2.2.0 -> 2.4.0 2024-10-31 13:31:00 -07:00
xiaomi_gateway3 home-assistant-custom-components.xiaomi_gateway3: 4.0.6 -> 4.0.7 2024-12-07 12:07:56 +00:00
xiaomi_miot home-assistant-custom-components.xiaomi_miot: add meta.longDescription, remove with lib 2024-11-19 20:35:27 +08:00
yassi
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.