From ff795bd45fa0ad6f40d3606c604c471da6f78ea7 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Fri, 27 Apr 2018 14:52:19 +0800 Subject: [PATCH 1/6] pythonPackages.pyfttt: init at 0.3.2 --- .../python-modules/pyfttt/default.nix | 24 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/development/python-modules/pyfttt/default.nix diff --git a/pkgs/development/python-modules/pyfttt/default.nix b/pkgs/development/python-modules/pyfttt/default.nix new file mode 100644 index 000000000000..44d6679e47c3 --- /dev/null +++ b/pkgs/development/python-modules/pyfttt/default.nix @@ -0,0 +1,24 @@ +{ stdenv, buildPythonPackage, fetchPypi +, requests }: + +buildPythonPackage rec { + pname = "pyfttt"; + version = "0.3.2"; + + src = fetchPypi { + inherit pname version; + sha256 = "10iq7c9c832ssl2xrvf62xf7znfvqzax6sq8ppsibq6wpb8dlnj5"; + }; + + propagatedBuildInputs = [ requests ]; + + # tests need a server to run against + doCheck = false; + + meta = with stdenv.lib; { + description = "Package for sending events to the IFTTT Webhooks Channel"; + homepage = https://github.com/briandconnelly/pyfttt; + maintainers = with maintainers; [ peterhoeg ]; + license = licenses.bsd2; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 05ac04a22bce..bb338bcc5a24 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -512,6 +512,8 @@ in { pyfakefs = callPackage ../development/python-modules/pyfakefs {}; + pyfttt = callPackage ../development/python-modules/pyfttt { }; + pygame = callPackage ../development/python-modules/pygame { }; pygame-git = callPackage ../development/python-modules/pygame/git.nix { }; From f535f7e2a119236ef8b2aa5c6005247f7782254c Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Fri, 27 Apr 2018 14:53:14 +0800 Subject: [PATCH 2/6] home-assistant: use pyfttt --- pkgs/servers/home-assistant/component-packages.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 01232bd94704..35790edf9d36 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -20,7 +20,7 @@ "alarm_control_panel.envisalink" = ps: with ps; [ ]; "alarm_control_panel.homematicip_cloud" = ps: with ps; [ ]; "alarm_control_panel.ialarm" = ps: with ps; [ ]; - "alarm_control_panel.ifttt" = ps: with ps; [ aiohttp-cors ]; + "alarm_control_panel.ifttt" = ps: with ps; [ aiohttp-cors pyfttt ]; "alarm_control_panel.manual" = ps: with ps; [ ]; "alarm_control_panel.manual_mqtt" = ps: with ps; [ paho-mqtt ]; "alarm_control_panel.mqtt" = ps: with ps; [ paho-mqtt ]; @@ -477,7 +477,7 @@ "hue.const" = ps: with ps; [ ]; "hue.errors" = ps: with ps; [ ]; "hydrawise" = ps: with ps; [ ]; - "ifttt" = ps: with ps; [ aiohttp-cors ]; + "ifttt" = ps: with ps; [ aiohttp-cors pyfttt ]; "ihc" = ps: with ps; [ ]; "ihc.const" = ps: with ps; [ ]; "ihc.ihcdevice" = ps: with ps; [ ]; From 4bdd7496ba65adc5557645f38f0586cbe950b498 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Fri, 27 Apr 2018 19:01:20 +0800 Subject: [PATCH 3/6] pythonPackages.WazeRouteCalculator: init 0.6 --- .../WazeRouteCalculator/default.nix | 24 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 26 insertions(+) create mode 100644 pkgs/development/python-modules/WazeRouteCalculator/default.nix diff --git a/pkgs/development/python-modules/WazeRouteCalculator/default.nix b/pkgs/development/python-modules/WazeRouteCalculator/default.nix new file mode 100644 index 000000000000..e67d81eccf7e --- /dev/null +++ b/pkgs/development/python-modules/WazeRouteCalculator/default.nix @@ -0,0 +1,24 @@ +{ stdenv, buildPythonPackage, fetchPypi +, requests }: + +buildPythonPackage rec { + pname = "WazeRouteCalculator"; + version = "0.6"; + + src = fetchPypi { + inherit pname version; + sha256 = "0zmnw4198a2kvqvsz1i4a3aa20r4afp2lai6fxbpq1ppv120h857"; + }; + + propagatedBuildInputs = [ requests ]; + + # there are no tests + doCheck = false; + + meta = with stdenv.lib; { + description = "Calculate actual route time and distance with Waze API"; + homepage = https://github.com/kovacsbalu/WazeRouteCalculator; + license = licenses.gpl3; + maintainers = with maintainers; [ peterhoeg ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index bb338bcc5a24..28baa2dfbe45 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -696,6 +696,8 @@ in { pyunbound = callPackage ../tools/networking/unbound/python.nix { }; + WazeRouteCalculator = callPackage ../development/python-modules/WazeRouteCalculator { }; + # packages defined here aafigure = callPackage ../development/python-modules/aafigure { }; From e1298bc9f02dcb485263b385aaecbd7cd85261eb Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Fri, 27 Apr 2018 19:01:56 +0800 Subject: [PATCH 4/6] home-assistant: use WazeRouteCalculator --- pkgs/servers/home-assistant/component-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 35790edf9d36..76e639438ff3 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -1112,7 +1112,7 @@ "sensor.vultr" = ps: with ps; [ vultr ]; "sensor.waqi" = ps: with ps; [ ]; "sensor.waterfurnace" = ps: with ps; [ ]; - "sensor.waze_travel_time" = ps: with ps; [ ]; + "sensor.waze_travel_time" = ps: with ps; [ WazeRouteCalculator ]; "sensor.whois" = ps: with ps; [ ]; "sensor.wink" = ps: with ps; [ ]; "sensor.wirelesstag" = ps: with ps; [ ]; From d7691e0c0b52600c00395601816d891ceab647ef Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Fri, 27 Apr 2018 22:29:04 +0800 Subject: [PATCH 5/6] pythonPackages.bt_proximity: init at 0.0.20180217 --- .../python-modules/bt-proximity/default.nix | 27 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 29 insertions(+) create mode 100644 pkgs/development/python-modules/bt-proximity/default.nix diff --git a/pkgs/development/python-modules/bt-proximity/default.nix b/pkgs/development/python-modules/bt-proximity/default.nix new file mode 100644 index 000000000000..dfd4d8f0cbf1 --- /dev/null +++ b/pkgs/development/python-modules/bt-proximity/default.nix @@ -0,0 +1,27 @@ +{ stdenv, buildPythonPackage, fetchFromGitHub +, pybluez }: + +buildPythonPackage rec { + pname = "bt-proximity"; + version = "0.0.20180217"; + + # pypi only has a pre-compiled wheel and no sources + src = fetchFromGitHub { + owner = "FrederikBolding"; + repo = "bluetooth-proximity"; + rev = "463bade8a9080b47f09bf4a47830b31c69c5dffd"; + sha256 = "0anfh90cj3c2g7zqrjvq0d6dzpb4hjl6gk8zw0r349j2zw9i4h7y"; + }; + + propagatedBuildInputs = [ pybluez ]; + + # there are no tests + doCheck = false; + + meta = with stdenv.lib; { + description = "Bluetooth Proximity Detection using Python"; + homepage = https://github.com/FrederikBolding/bluetooth-proximity; + maintainers = with maintainers; [ peterhoeg ]; + license = licenses.asl20; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 28baa2dfbe45..b8b46dec2f29 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -272,6 +272,8 @@ in { browsermob-proxy = disabledIf isPy3k (callPackage ../development/python-modules/browsermob-proxy {}); + bt_proximity = callPackage ../development/python-modules/bt-proximity { }; + bugseverywhere = callPackage ../applications/version-management/bugseverywhere {}; cachecontrol = callPackage ../development/python-modules/cachecontrol { }; From 74b63f26f010a0022df7ca301d50745cf3ffa455 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Fri, 27 Apr 2018 22:29:25 +0800 Subject: [PATCH 6/6] home-assistant: use bt_proximity --- pkgs/servers/home-assistant/component-packages.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix index 76e639438ff3..399f6a205817 100644 --- a/pkgs/servers/home-assistant/component-packages.nix +++ b/pkgs/servers/home-assistant/component-packages.nix @@ -326,7 +326,7 @@ "device_tracker.automatic" = ps: with ps; [ aiohttp-cors ]; "device_tracker.bbox" = ps: with ps; [ ]; "device_tracker.bluetooth_le_tracker" = ps: with ps; [ ]; - "device_tracker.bluetooth_tracker" = ps: with ps; [ ]; + "device_tracker.bluetooth_tracker" = ps: with ps; [ bt_proximity ]; "device_tracker.bmw_connected_drive" = ps: with ps; [ ]; "device_tracker.bt_home_hub_5" = ps: with ps; [ ]; "device_tracker.cisco_ios" = ps: with ps; [ pexpect ];