mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-10-10 17:38:01 +00:00
Add flake8 to tox, disable qa on pyHS100/__init__.py, fix py27 compatibility (#31)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
# flake8: noqa
|
||||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
from pyHS100.pyHS100 import SmartBulb, SmartPlug, TPLinkSmartHomeProtocol, SmartPlugException
|
||||
|
@@ -17,6 +17,7 @@ http://www.apache.org/licenses/LICENSE-2.0
|
||||
# python2 compatibility
|
||||
from __future__ import absolute_import
|
||||
from __future__ import unicode_literals
|
||||
from future.utils import raise_from
|
||||
try:
|
||||
basestring
|
||||
except NameError:
|
||||
@@ -70,7 +71,7 @@ class SmartDevice(object):
|
||||
request={target: {cmd: arg}}
|
||||
)
|
||||
except Exception as ex:
|
||||
raise SmartPlugException(ex) from ex
|
||||
raise_from(SmartPlugException(), ex)
|
||||
|
||||
if target not in response:
|
||||
raise SmartPlugException("No required {} in response: {}".format(target, response))
|
||||
|
Reference in New Issue
Block a user