git.iko.soy/typeable/nixpkgs
on master help sign in
Merge pull request #54904 from dotlambda/home-assistant-cli-0.4.2

home-assistant-cli: 0.3.0 -> 0.4.2

commit5acb21453fb37ee1608f219a39eae36ed65d3998 authorRobert Schütz <rschuetz17@gmail.com> dateWed 30 Jan 2019, 09:18 (8 years ago) parentb35cee1c3b01ee
2 files changed+13−12
nixos/tests/home-assistant.nix+1−1 pkgs/servers/home-assistant/cli.nix+12−11
nixos/tests/home-assistant.nix+1−1
@@ -73,7 +73,7 @@ in {
7373 $hass->succeed("curl http://localhost:8123/api/states/binary_sensor.mqtt_binary_sensor -H 'x-ha-access: ${apiPassword}' | grep -qF '\"state\": \"on\"'");
7474
7575 # Toggle a binary sensor using hass-cli
76− $hass->succeed("${hassCli} entity get binary_sensor.mqtt_binary_sensor | grep -qF '\"state\": \"on\"'");
76+ $hass->succeed("${hassCli} --output json entity get binary_sensor.mqtt_binary_sensor | grep -qF '\"state\": \"on\"'");
7777 $hass->succeed("${hassCli} entity edit binary_sensor.mqtt_binary_sensor --json='{\"state\": \"off\"}'");
7878 $hass->succeed("curl http://localhost:8123/api/states/binary_sensor.mqtt_binary_sensor -H 'x-ha-access: ${apiPassword}' | grep -qF '\"state\": \"off\"'");
7979
pkgs/servers/home-assistant/cli.nix+12−11
@@ -1,29 +1,30 @@
1−{ lib, python3 }:
1+# dateparser tests fail on pyton37: https://github.com/NixOS/nixpkgs/issues/52766
2+{ lib, python36, glibcLocales }:
23
3−python3.pkgs.buildPythonApplication rec {
4+python36.pkgs.buildPythonApplication rec {
45 pname = "homeassistant-cli";
5− version = "0.3.0";
6+ version = "0.4.2";
67
7− src = python3.pkgs.fetchPypi {
8+ src = python36.pkgs.fetchPypi {
89 inherit pname version;
9− sha256 = "42d7cb008801d7a448b62aed1fc46dd450ee67397bf16faabb02f691417db4b2";
10+ sha256 = "e0b05af9e49baf88a44f1b36c3446a106223016dceefd5f9910e204af5901f44";
1011 };
1112
1213 postPatch = ''
1314 # Ignore pinned versions
14− sed -i "s/'\(.*\)==.*'/'\1'/g" setup.py
15+ sed -i "s/'\(.*\)\(==\|>=\).*'/'\1'/g" setup.py
1516 '';
1617
17− propagatedBuildInputs = with python3.pkgs; [
18− requests pyyaml netdisco click click-log tabulate idna jsonpath_rw jinja2
18+ propagatedBuildInputs = with python36.pkgs; [
19+ requests pyyaml netdisco click click-log tabulate idna jsonpath_rw jinja2 dateparser
1920 ];
2021
21− checkInputs = with python3.pkgs; [
22− pytest requests-mock
22+ checkInputs = with python36.pkgs; [
23+ pytest requests-mock glibcLocales
2324 ];
2425
2526 checkPhase = ''
26− pytest
27+ LC_ALL=en_US.UTF-8 pytest
2728 '';
2829
2930 meta = with lib; {