From e3cfd89178edf68891ddaa2ddcc91a2906936242 Mon Sep 17 00:00:00 2001 From: oddlama Date: Mon, 27 Jan 2025 03:48:33 +0100 Subject: [PATCH] feat: add lg-webos-remote-control and clock-weather-card --- .../clock-weather-card/package.json | 54 +++++++++++++++++++ .../clock-weather-card/package.nix | 52 ++++++++++++++++++ hosts/sausebiene/home-assistant.nix | 28 +++++----- 3 files changed, 119 insertions(+), 15 deletions(-) create mode 100644 hosts/sausebiene/hass-lovelace/clock-weather-card/package.json create mode 100644 hosts/sausebiene/hass-lovelace/clock-weather-card/package.nix diff --git a/hosts/sausebiene/hass-lovelace/clock-weather-card/package.json b/hosts/sausebiene/hass-lovelace/clock-weather-card/package.json new file mode 100644 index 0000000..27d6f02 --- /dev/null +++ b/hosts/sausebiene/hass-lovelace/clock-weather-card/package.json @@ -0,0 +1,54 @@ +{ + "name": "clock-weather-card", + "version": "2.8.7", + "description": "Lovelace clock-weather-card", + "keywords": [ + "home-assistant", + "homeassistant", + "hass", + "automation", + "lovelace", + "custom-cards" + ], + "module": "clock-weather-card.js", + "repository": "git@github.com:pkissling/clock-weather-card.git", + "author": "Patrick Kissling ", + "license": "MIT", + "type": "module", + "dependencies": { + "custom-card-helpers": "^1.8.0", + "home-assistant-js-websocket": "^9.0.0", + "lit": "^2.8.0", + "luxon": "^3.4.3" + }, + "devDependencies": { + "@babel/core": "^7.15.0", + "@babel/plugin-proposal-class-properties": "^7.14.5", + "@babel/plugin-proposal-decorators": "^7.14.5", + "@rollup/plugin-babel": "^6.0.0", + "@rollup/plugin-image": "^3.0.0", + "@rollup/plugin-json": "^6.0.0", + "@rollup/plugin-node-resolve": "^16.0.0", + "@types/luxon": "^3.3.2", + "@typescript-eslint/eslint-plugin": "^7.0.0", + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.0.1", + "eslint-config-standard-with-typescript": "^43.0.0", + "eslint-plugin-import": "^2.25.2", + "eslint-plugin-n": "^15.0.0 || ^16.0.0 || ^17.0.0", + "eslint-plugin-promise": "^7.0.0", + "rollup": "^4.0.0", + "rollup-plugin-commonjs": "^10.1.0", + "rollup-plugin-gzip": "^4.0.0", + "rollup-plugin-serve": "^3.0.0", + "@rollup/plugin-terser": "^0.4.0", + "rollup-plugin-typescript2": "^0.36.0", + "typescript": "*" + }, + "scripts": { + "start": "rollup -c rollup.config.dev.js --watch", + "build": "yarn rollup", + "lint": "eslint **/*.ts --max-warnings 0", + "rollup": "rollup -c" + } +} diff --git a/hosts/sausebiene/hass-lovelace/clock-weather-card/package.nix b/hosts/sausebiene/hass-lovelace/clock-weather-card/package.nix new file mode 100644 index 0000000..dfd5b6b --- /dev/null +++ b/hosts/sausebiene/hass-lovelace/clock-weather-card/package.nix @@ -0,0 +1,52 @@ +{ + lib, + fetchFromGitHub, + mkYarnPackage, + fetchYarnDeps, +}: +mkYarnPackage rec { + pname = "clock-weather-card"; + version = "2.8.7"; + + src = fetchFromGitHub { + owner = "pkissling"; + repo = "clock-weather-card"; + rev = "v${version}"; + hash = "sha256-ylJNI0DE+3j8EZFpUmuuBnII8nBMrJ5bhlGVh3M25eo="; + }; + + packageJSON = ./package.json; + offlineCache = fetchYarnDeps { + yarnLock = src + "/yarn.lock"; + hash = "sha256-EUuPF2kS6CaJ2MUYoBocLOQyOgkhRHd34ul+efJua7Q="; + }; + + buildPhase = '' + runHook preBuild + + yarn build + + runHook postBuild + ''; + + installPhase = '' + runHook preInstall + + mkdir $out + cp ./deps/clock-weather-card/dist/clock-weather-card.js $out/ + + runHook postInstall + ''; + + doDist = false; + + meta = with lib; { + description = "A Home Assistant Card indicating today's date/time, along with an iOS inspired weather forecast for the next days with animated icons"; + homepage = "https://github.com/pkissling/clock-weather-card"; + changelog = "https://github.com/pkissling/clock-weather-card/blob/${src.rev}/CHANGELOG.md"; + license = licenses.mit; + maintainers = with maintainers; [ oddlama ]; + mainProgram = "clock-weather-card"; + platforms = platforms.linux; + }; +} diff --git a/hosts/sausebiene/home-assistant.nix b/hosts/sausebiene/home-assistant.nix index 845e91b..f86fa05 100644 --- a/hosts/sausebiene/home-assistant.nix +++ b/hosts/sausebiene/home-assistant.nix @@ -63,21 +63,19 @@ in })) ]; - customLovelaceModules = - let - mods = pkgs.home-assistant-custom-lovelace-modules; - in - [ - mods.bubble-card - mods.weather-card - mods.mini-graph-card - mods.card-mod - mods.mushroom - mods.multiple-entity-row - mods.button-card - mods.weather-chart-card - mods.hourly-weather - ]; + customLovelaceModules = with pkgs.home-assistant-custom-lovelace-modules; [ + (pkgs.callPackage ./hass-lovelace/clock-weather-card/package.nix { }) + bubble-card + button-card + card-mod + hourly-weather + lg-webos-remote-control + mini-graph-card + multiple-entity-row + mushroom + weather-card + weather-chart-card + ]; config = { default_config = { };