475ccf21e6
With has_entity_name the device name is prepended, so the API's 'West Wood Club <club>' names rendered as 'West Wood Club West Wood Club <club>'. Strip the prefix to show e.g. 'West Wood Club Dun Laoghaire'. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
44 lines
1.2 KiB
Nix
44 lines
1.2 KiB
Nix
{
|
|
description = "Home Assistant integration for West Wood gyms (PerfectGym API)";
|
|
|
|
inputs = {
|
|
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
|
|
flake-utils.url = "github:numtide/flake-utils";
|
|
};
|
|
|
|
outputs = { self, nixpkgs, flake-utils }:
|
|
let
|
|
# Adds the integration to pkgs.home-assistant-custom-components so it can be
|
|
# used directly in services.home-assistant.customComponents.
|
|
overlay = final: prev: {
|
|
home-assistant-custom-components = prev.home-assistant-custom-components // {
|
|
west_wood_club = final.buildHomeAssistantComponent {
|
|
owner = "deplayer0";
|
|
domain = "west_wood_club";
|
|
version = "0.1.1";
|
|
src = ./.;
|
|
};
|
|
};
|
|
};
|
|
in
|
|
{
|
|
overlays.default = overlay;
|
|
}
|
|
// flake-utils.lib.eachDefaultSystem (system:
|
|
let
|
|
pkgs = nixpkgs.legacyPackages.${system}.extend overlay;
|
|
in
|
|
{
|
|
packages = rec {
|
|
west_wood_club = pkgs.home-assistant-custom-components.west_wood_club;
|
|
default = west_wood_club;
|
|
};
|
|
|
|
devShells.default = pkgs.mkShell {
|
|
packages = with pkgs; [
|
|
mitmproxy
|
|
];
|
|
};
|
|
});
|
|
}
|