Update pyHS100.py

This commit is contained in:
GadgetReactor 2016-07-09 20:36:33 +08:00 committed by GitHub
parent 89481ad06e
commit ef85f939fd

View File

@ -1,7 +1,11 @@
import logging, socket, codecs, json import logging
import socket
import codecs
import json
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
class SmartPlug(object): class SmartPlug(object):
"""Class to access TPLink Switch. """Class to access TPLink Switch.
@ -95,7 +99,6 @@ class SmartPlug(object):
info = json.loads(response) info = json.loads(response)
# info is reserved for future expansion. # info is reserved for future expansion.
# The JSON response from the smartplug provide smartplug system information
sys_info = info["system"]["get_sysinfo"] sys_info = info["system"]["get_sysinfo"]
relay_state = sys_info["relay_state"] relay_state = sys_info["relay_state"]
return relay_state return relay_state