From b597a1c1434f90065cfaa185426fdf8bb6c7e366 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Sat, 25 Apr 2020 21:38:42 +0100 Subject: feat(third_party/python): Vendor broadlink-python using git-subtree --- third_party/python/broadlink.nix | 22 ---------------------- third_party/python/broadlink/broadlink/__init__.py | 4 ++-- third_party/python/broadlink/default.nix | 15 +++++++++++++++ 3 files changed, 17 insertions(+), 24 deletions(-) delete mode 100644 third_party/python/broadlink.nix create mode 100644 third_party/python/broadlink/default.nix (limited to 'third_party') diff --git a/third_party/python/broadlink.nix b/third_party/python/broadlink.nix deleted file mode 100644 index 75db1ef2b7af..000000000000 --- a/third_party/python/broadlink.nix +++ /dev/null @@ -1,22 +0,0 @@ -# Python package for controlling the Broadlink RM Pro Infrared -# controller. -# -# https://github.com/mjg59/python-broadlink -{ pkgs, lib, ... }: - -let - inherit (pkgs) fetchFromGitHub; - inherit (pkgs.python3Packages) buildPythonPackage cryptography; -in buildPythonPackage (lib.fix (self: { - pname = "python-broadlink"; - version = "0.13.2"; - - src = fetchFromGitHub { - owner = "mjg59"; - repo = "python-broadlink"; - rev = self.version; - sha256 = "0dwqzx294sjdc8dg1sd3z6mhll0zzsb8k0lzs63nyhm2nc9pyv6j"; - }; - - propagatedBuildInputs = [ cryptography ]; -})) diff --git a/third_party/python/broadlink/broadlink/__init__.py b/third_party/python/broadlink/broadlink/__init__.py index 5253d7cfdab8..27619a136ea3 100644 --- a/third_party/python/broadlink/broadlink/__init__.py +++ b/third_party/python/broadlink/broadlink/__init__.py @@ -1114,5 +1114,5 @@ def setup(ssid, password, security_mode): sock = socket.socket(socket.AF_INET, # Internet socket.SOCK_DGRAM) # UDP sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) - sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) - sock.sendto(payload, ('255.255.255.255', 80)) + # sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1) + sock.sendto(payload, ('192.168.10.1', 80)) diff --git a/third_party/python/broadlink/default.nix b/third_party/python/broadlink/default.nix new file mode 100644 index 000000000000..e316d83d1d71 --- /dev/null +++ b/third_party/python/broadlink/default.nix @@ -0,0 +1,15 @@ +# Python package for controlling the Broadlink RM Pro Infrared +# controller. +# +# https://github.com/mjg59/python-broadlink +{ pkgs, lib, ... }: + +let + inherit (pkgs) fetchFromGitHub; + inherit (pkgs.python3Packages) buildPythonPackage cryptography; +in buildPythonPackage (lib.fix (self: { + pname = "python-broadlink"; + version = "0.13.2"; + src = ./.; + propagatedBuildInputs = [ cryptography ]; +})) -- cgit 1.4.1