mirror of
https://github.com/python-kasa/python-kasa.git
synced 2025-10-22 15:28:01 +00:00
Don't crash on devices not reporting features (#317)
Returns an empty set if no feature information is available
This commit is contained in:
@@ -262,7 +262,11 @@ class SmartDevice:
|
||||
@requires_update
|
||||
def features(self) -> Set[str]:
|
||||
"""Return a set of features that the device supports."""
|
||||
return set(self.sys_info["feature"].split(":"))
|
||||
try:
|
||||
return set(self.sys_info["feature"].split(":"))
|
||||
except KeyError:
|
||||
_LOGGER.debug("Device does not have feature information")
|
||||
return set()
|
||||
|
||||
@property # type: ignore
|
||||
@requires_update
|
||||
|
Reference in New Issue
Block a user