depot/pkgs/servers/home-assistant/custom-components
Luke Granger-Brown 57725ef3ec Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce
git-subtree-dir: third_party/nixpkgs
git-subtree-split: 76612b17c0ce71689921ca12d9ffdc9c23ce40b2
2024-11-10 23:59:47 +00:00
..
adaptive_lighting Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
alarmo Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
auth-header Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
average Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
awtrix Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
better_thermostat Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
bodymiscale Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
climate_group Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
dwd Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
elevenlabs_tts Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
emporia_vue Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
epex_spot Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
frigate Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
garmin_connect Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
govee-lan Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
gpio Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
homematicip_local Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
indego Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
local_luftdaten Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
localtuya Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
mass Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
midea-air-appliances-lan Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
midea_ac Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
midea_ac_lan Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
miele Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
moonraker Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
nest_protect Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
ntfy Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
omnik_inverter Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
prometheus_sensor Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
samsungtv-smart Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
sensi Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
smartir Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
smartthinq-sensors Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
solax_modbus Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
solis-sensor Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
somweb Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
spook Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
tuya_local Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
volkswagen_we_connect_id Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
volkswagencarnet Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
waste_collection_schedule Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
xiaomi_gateway3 Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
xiaomi_miot Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
yassi Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00:00
README.md Squashed 'third_party/nixpkgs/' content from commit 76612b17c0ce 2024-11-10 23:59:47 +00: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.