File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -721,6 +721,15 @@ def is_color(self) -> bool:
721
721
"""Return True if the device supports color changes."""
722
722
return False
723
723
724
+ @property
725
+ def internal_state (self ) -> Any :
726
+ """Return the internal state of the instance.
727
+
728
+ The returned object contains the raw results from the last update call.
729
+ This should only be used for debugging purposes.
730
+ """
731
+ return self ._last_update
732
+
724
733
def __repr__ (self ):
725
734
if self ._last_update is None :
726
735
return f"<{ self ._device_type } at { self .host } - update() needed>"
Original file line number Diff line number Diff line change @@ -134,3 +134,8 @@ async def test_childrens(dev):
134
134
assert len (dev .children ) > 0
135
135
else :
136
136
assert len (dev .children ) == 0
137
+
138
+
139
+ async def test_internal_state (dev ):
140
+ """Make sure the internal state returns the last update results."""
141
+ assert dev .internal_state == dev ._last_update
You can’t perform that action at this time.
0 commit comments