mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 19:23:34 +00:00
wrap sysinfo to defaultdict to return None for keys which do not exist, makes unsupported keys not to fail hard (#72)
This commit is contained in:
parent
d15e7be4f3
commit
0927930f41
@ -16,6 +16,7 @@ http://www.apache.org/licenses/LICENSE-2.0
|
||||
import datetime
|
||||
import logging
|
||||
import socket
|
||||
from collections import defaultdict
|
||||
|
||||
from .types import SmartDeviceException
|
||||
from .protocol import TPLinkSmartHomeProtocol
|
||||
@ -112,7 +113,7 @@ class SmartDevice(object):
|
||||
:return: System information dict.
|
||||
:rtype: dict
|
||||
"""
|
||||
return self.get_sysinfo()
|
||||
return defaultdict(lambda: None, self.get_sysinfo())
|
||||
|
||||
def get_sysinfo(self):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user