about summary refs log tree commit diff
path: root/pkgs/servers/home-assistant/custom-components/emporia_vue/default.nix
blob: 64b55e214a6dee0edcf1c0bcc8fa57d54144f096 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ lib
, fetchFromGitHub
, buildHomeAssistantComponent
, pyemvue
}:

buildHomeAssistantComponent rec {
  owner = "presto8";
  domain = "emporia_vue";
  version = "0.8.3";

  src = fetchFromGitHub {
    owner = "magico13";
    repo = "ha-emporia-vue";
    rev = "v${version}";
    hash = "sha256-6NrRuBjpulT66pVUfW9ujULL5HSzfgyic1pKEBRupNA=";
  };

  propagatedBuildInputs = [
    pyemvue
  ];

  postPatch = ''
    substituteInPlace custom_components/emporia_vue/manifest.json --replace-fail 'pyemvue==0.17.1' 'pyemvue>=0.17.1'
  '';

  dontBuild = true;

  meta = with lib; {
    description = "Reads data from the Emporia Vue energy monitor into Home Assistant";
    homepage = "https://github.com/magico13/ha-emporia-vue";
    changelog = "https://github.com/magico13/ha-emporia-vue/releases/tag/v${version}";
    maintainers = with maintainers; [ presto8 ];
    license = licenses.mit;
  };
}