Return None instead of raising an exception on missing, valid emeter keys (#146)

Fixes #142

Also, update the pre-commit hooks to their newest versions
This commit is contained in:
Teemu R
2021-03-18 19:22:10 +01:00
committed by GitHub
parent 2fe1b209d0
commit 1ee4757fdb
6 changed files with 28 additions and 9 deletions

View File

@@ -87,7 +87,8 @@ class EmeterStatus(dict):
if i.startswith(item):
return self.__getitem__(i) / 1000
raise SmartDeviceException("Unable to find a value for '%s'" % item)
_LOGGER.debug(f"Unable to find value for '{item}'")
return None
def requires_update(f):