mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-08-09 20:24:02 +00:00
Adds model check to current_consumption() and removes whitespace
This commit is contained in:
@@ -203,7 +203,6 @@ class SmartPlug(object):
|
|||||||
True: Success
|
True: Success
|
||||||
False: Failure or not supported by switch
|
False: Failure or not supported by switch
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if self.model == 100:
|
if self.model == 100:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
@@ -216,6 +215,8 @@ class SmartPlug(object):
|
|||||||
|
|
||||||
def current_consumption(self):
|
def current_consumption(self):
|
||||||
"""Get the current power consumption in Watt."""
|
"""Get the current power consumption in Watt."""
|
||||||
|
if self.model == 100:
|
||||||
|
return False
|
||||||
|
|
||||||
response = self.get_emeter_realtime()
|
response = self.get_emeter_realtime()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user