mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-03-13 20:11:32 +00:00
Adding in support for the HS200 Wall switch referencing issues (#4), simplifying model determination
This commit is contained in:
parent
225bf47ace
commit
fe00041130
@ -9,6 +9,7 @@ import codecs
|
||||
import json
|
||||
import datetime
|
||||
import sys
|
||||
import re
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@ -252,12 +253,12 @@ class SmartPlug(object):
|
||||
def _identify_model(self):
|
||||
"""Query sysinfo and determine model"""
|
||||
sys_info = self.get_info()
|
||||
|
||||
if sys_info["system"]["get_sysinfo"]["model"][:5] == 'HS100':
|
||||
model = 100
|
||||
elif sys_info["system"]["get_sysinfo"]["model"][:5] == 'HS200':
|
||||
model = 200
|
||||
elif sys_info["system"]["get_sysinfo"]["model"][:5] == 'HS110':
|
||||
model = 110
|
||||
|
||||
model = re.sub('HS', '', sys_info["system"]["get_sysinfo"]["model"][:5])
|
||||
#if sys_info["system"]["get_sysinfo"]["model"][:5] == 'HS100':
|
||||
# model = 100
|
||||
#elif sys_info["system"]["get_sysinfo"]["model"][:5] == 'HS200':
|
||||
# model = 200
|
||||
#elif sys_info["system"]["get_sysinfo"]["model"][:5] == 'HS110':
|
||||
# model = 110
|
||||
print model
|
||||
return model
|
||||
|
Loading…
x
Reference in New Issue
Block a user