mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-10-13 10:58:02 +00:00
Leverage data from UDP discovery to initialize device structure (#132)
* avoid talking to devices after UDP discovery * formatting fix * more formatting * more formatting changes * undo gitignore changes * fixing git ignore for black Co-authored-by: dlee1j1 <dlee1j@yahoo.comm>
This commit is contained in:
@@ -304,6 +304,11 @@ class SmartDevice:
|
||||
# TODO: keep accessible for tests
|
||||
self._sys_info = self._last_update["system"]["get_sysinfo"]
|
||||
|
||||
def update_from_discover_info(self, info):
|
||||
"""Update state from info from the discover call."""
|
||||
self._last_update = info
|
||||
self._sys_info = info["system"]["get_sysinfo"]
|
||||
|
||||
@property # type: ignore
|
||||
@requires_update
|
||||
def sys_info(self) -> Dict[str, Any]:
|
||||
|
Reference in New Issue
Block a user