From 8ca2345fd4fde5b6ecc924a03c9338f05474ac51 Mon Sep 17 00:00:00 2001
From: Caleb <finish.06@gmail.com>
Date: Mon, 5 Dec 2016 23:35:54 -0600
Subject: [PATCH] Pyunifi dep (#4754)

* change unifi dependency to pyunifi

* Change dependency to fix #4336

* Run gen_requirements_all.py script

* Changed import statement to reflect new package

* Updated test_unifiy.py with different module

* Update requirements_all.txt
---
 homeassistant/components/device_tracker/unifi.py | 4 ++--
 requirements_all.txt                             | 6 +++---
 tests/components/device_tracker/test_unifi.py    | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/homeassistant/components/device_tracker/unifi.py b/homeassistant/components/device_tracker/unifi.py
index e139775e031..ab84eb22e04 100644
--- a/homeassistant/components/device_tracker/unifi.py
+++ b/homeassistant/components/device_tracker/unifi.py
@@ -14,7 +14,7 @@ from homeassistant.components.device_tracker import DOMAIN, PLATFORM_SCHEMA
 from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
 
 # Unifi package doesn't list urllib3 as a requirement
-REQUIREMENTS = ['urllib3', 'unifi==1.2.5']
+REQUIREMENTS = ['urllib3', 'pyunifi==1.3']
 
 _LOGGER = logging.getLogger(__name__)
 CONF_PORT = 'port'
@@ -34,7 +34,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
 
 def get_scanner(hass, config):
     """Setup Unifi device_tracker."""
-    from unifi.controller import Controller
+    from pyunifi.controller import Controller
 
     host = config[DOMAIN].get(CONF_HOST)
     username = config[DOMAIN].get(CONF_USERNAME)
diff --git a/requirements_all.txt b/requirements_all.txt
index d468f2aa863..6f1ca5eb4e1 100644
--- a/requirements_all.txt
+++ b/requirements_all.txt
@@ -479,6 +479,9 @@ python-twitch==1.3.0
 # homeassistant.components.wink
 python-wink==0.11.0
 
+# homeassistant.components.device_tracker.unifi
+pyunifi==1.3
+
 # homeassistant.components.keyboard
 # pyuserinput==0.1.11
 
@@ -569,9 +572,6 @@ twilio==5.4.0
 # homeassistant.components.sensor.uber
 uber_rides==0.2.7
 
-# homeassistant.components.device_tracker.unifi
-unifi==1.2.5
-
 # homeassistant.components.device_tracker.unifi
 urllib3
 
diff --git a/tests/components/device_tracker/test_unifi.py b/tests/components/device_tracker/test_unifi.py
index 5482740ce11..12d296959dc 100644
--- a/tests/components/device_tracker/test_unifi.py
+++ b/tests/components/device_tracker/test_unifi.py
@@ -3,7 +3,7 @@ import unittest
 from unittest import mock
 import urllib
 
-from unifi import controller
+from pyunifi import controller
 import voluptuous as vol
 
 from tests.common import get_test_home_assistant
-- 
GitLab