Fix for SmartStrip repr (#169)

* Added unit tests for repr.

* Fix repr for SmartStrip.

Fixes #165
This commit is contained in:
Alex
2019-04-08 21:19:42 -07:00
committed by Teemu R
parent 960ec6a346
commit 461440e8b1
4 changed files with 13 additions and 1 deletions

View File

@@ -558,9 +558,12 @@ class SmartDevice(object):
raise NotImplementedError("Device subclass needs to implement this.")
def __repr__(self):
is_on = self.is_on
if callable(is_on):
is_on = is_on()
return "<%s at %s (%s), is_on: %s - dev specific: %s>" % (
self.__class__.__name__,
self.host,
self.alias,
self.is_on,
is_on,
self.state_information)