Port PyNetgear from external to requirements.txt

pull/224/head
Paulus Schoutsen 2015-07-19 23:44:32 -07:00
parent 4edf53899d
commit 43cc3624ee
4 changed files with 6 additions and 18 deletions

3
.gitmodules vendored
View File

@ -1,6 +1,3 @@
[submodule "homeassistant/external/pynetgear"]
path = homeassistant/external/pynetgear
url = https://github.com/balloob/pynetgear.git
[submodule "homeassistant/external/pywemo"]
path = homeassistant/external/pywemo
url = https://github.com/balloob/pywemo.git

View File

@ -43,6 +43,7 @@ from homeassistant.components.device_tracker import DOMAIN
MIN_TIME_BETWEEN_SCANS = timedelta(seconds=5)
_LOGGER = logging.getLogger(__name__)
REQUIREMENTS = ['pynetgear>=0.1']
def get_scanner(hass, config):
@ -64,22 +65,10 @@ class NetgearDeviceScanner(object):
""" This class queries a Netgear wireless router using the SOAP-API. """
def __init__(self, host, username, password):
import pynetgear
self.last_results = []
try:
# Pylint does not play nice if not every folders has an __init__.py
# pylint: disable=no-name-in-module, import-error
import homeassistant.external.pynetgear.pynetgear as pynetgear
except ImportError:
_LOGGER.exception(
("Failed to import pynetgear. "
"Did you maybe not run `git submodule init` "
"and `git submodule update`?"))
self.success_init = False
return
self._api = pynetgear.Netgear(host, username, password)
self.lock = threading.Lock()

@ -1 +0,0 @@
Subproject commit e946ecf7926b9b2adaa1e3127a9738201a1b1fc7

View File

@ -79,3 +79,6 @@ PyMata==2.07a
# Mysensors
https://github.com/theolind/pymysensors/archive/master.zip#egg=pymysensors-0.1
# Netgear (device_tracker.netgear)
pynetgear>=0.1