Added KL125 and HS200 fixture dumps and updated tests to run on new format (#160)

* Added new fixtures

* Refactored bulb categories and check for emeter on run

* linting changes
This commit is contained in:
Brian Davis
2021-05-11 09:47:52 -06:00
committed by GitHub
parent 0471e1a5a8
commit 28a902c485
4 changed files with 125 additions and 4 deletions

View File

@@ -265,7 +265,9 @@ class FakeTransportProtocol(TPLinkSmartHomeProtocol):
# if we have emeter support, we need to add the missing pieces
for module in ["emeter", "smartlife.iot.common.emeter"]:
for etype in ["get_realtime", "get_daystat", "get_monthstat"]:
if etype in info[module]: # if the fixture has the data, use it
if (
module in info and etype in info[module]
): # if the fixture has the data, use it
# print("got %s %s from fixture: %s" % (module, etype, info[module][etype]))
proto[module][etype] = info[module][etype]
else: # otherwise fall back to the static one