forked from mirrors/nixpkgs
Merge pull request #54904 from dotlambda/home-assistant-cli-0.4.2
home-assistant-cli: 0.3.0 -> 0.4.2
This commit is contained in:
commit
5acb21453f
|
@ -73,7 +73,7 @@ in {
|
||||||
$hass->succeed("curl http://localhost:8123/api/states/binary_sensor.mqtt_binary_sensor -H 'x-ha-access: ${apiPassword}' | grep -qF '\"state\": \"on\"'");
|
$hass->succeed("curl http://localhost:8123/api/states/binary_sensor.mqtt_binary_sensor -H 'x-ha-access: ${apiPassword}' | grep -qF '\"state\": \"on\"'");
|
||||||
|
|
||||||
# Toggle a binary sensor using hass-cli
|
# Toggle a binary sensor using hass-cli
|
||||||
$hass->succeed("${hassCli} entity get binary_sensor.mqtt_binary_sensor | grep -qF '\"state\": \"on\"'");
|
$hass->succeed("${hassCli} --output json entity get binary_sensor.mqtt_binary_sensor | grep -qF '\"state\": \"on\"'");
|
||||||
$hass->succeed("${hassCli} entity edit binary_sensor.mqtt_binary_sensor --json='{\"state\": \"off\"}'");
|
$hass->succeed("${hassCli} entity edit binary_sensor.mqtt_binary_sensor --json='{\"state\": \"off\"}'");
|
||||||
$hass->succeed("curl http://localhost:8123/api/states/binary_sensor.mqtt_binary_sensor -H 'x-ha-access: ${apiPassword}' | grep -qF '\"state\": \"off\"'");
|
$hass->succeed("curl http://localhost:8123/api/states/binary_sensor.mqtt_binary_sensor -H 'x-ha-access: ${apiPassword}' | grep -qF '\"state\": \"off\"'");
|
||||||
|
|
||||||
|
|
|
@ -1,29 +1,30 @@
|
||||||
{ lib, python3 }:
|
# dateparser tests fail on pyton37: https://github.com/NixOS/nixpkgs/issues/52766
|
||||||
|
{ lib, python36, glibcLocales }:
|
||||||
|
|
||||||
python3.pkgs.buildPythonApplication rec {
|
python36.pkgs.buildPythonApplication rec {
|
||||||
pname = "homeassistant-cli";
|
pname = "homeassistant-cli";
|
||||||
version = "0.3.0";
|
version = "0.4.2";
|
||||||
|
|
||||||
src = python3.pkgs.fetchPypi {
|
src = python36.pkgs.fetchPypi {
|
||||||
inherit pname version;
|
inherit pname version;
|
||||||
sha256 = "42d7cb008801d7a448b62aed1fc46dd450ee67397bf16faabb02f691417db4b2";
|
sha256 = "e0b05af9e49baf88a44f1b36c3446a106223016dceefd5f9910e204af5901f44";
|
||||||
};
|
};
|
||||||
|
|
||||||
postPatch = ''
|
postPatch = ''
|
||||||
# Ignore pinned versions
|
# Ignore pinned versions
|
||||||
sed -i "s/'\(.*\)==.*'/'\1'/g" setup.py
|
sed -i "s/'\(.*\)\(==\|>=\).*'/'\1'/g" setup.py
|
||||||
'';
|
'';
|
||||||
|
|
||||||
propagatedBuildInputs = with python3.pkgs; [
|
propagatedBuildInputs = with python36.pkgs; [
|
||||||
requests pyyaml netdisco click click-log tabulate idna jsonpath_rw jinja2
|
requests pyyaml netdisco click click-log tabulate idna jsonpath_rw jinja2 dateparser
|
||||||
];
|
];
|
||||||
|
|
||||||
checkInputs = with python3.pkgs; [
|
checkInputs = with python36.pkgs; [
|
||||||
pytest requests-mock
|
pytest requests-mock glibcLocales
|
||||||
];
|
];
|
||||||
|
|
||||||
checkPhase = ''
|
checkPhase = ''
|
||||||
pytest
|
LC_ALL=en_US.UTF-8 pytest
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = with lib; {
|
meta = with lib; {
|
||||||
|
|
Loading…
Reference in a new issue