mirror of
https://github.com/micahqcade/custom_vesync.git
synced 2025-02-14 02:59:01 +01:00
Add else condition if API call returns none (Sourcery refactored) (#12)
* Add else condition if API call returns none I was getting exceptions when the API call returned none. * 'Refactored by Sourcery' Co-authored-by: Brian Orpin <brian.orpin@gmail.com> Co-authored-by: Sourcery AI <>
This commit is contained in:
parent
ee1e7e7496
commit
616f0db5ce
@ -877,9 +877,10 @@ class VeSyncHumid200300S(VeSyncBaseDevice):
|
||||
)
|
||||
if r is None or not isinstance(r, dict):
|
||||
logger.debug("Error getting status of %s ", self.device_name)
|
||||
outer_result = r.get("result", {})
|
||||
outer_result = None
|
||||
else:
|
||||
outer_result = r.get("result", {})
|
||||
inner_result = None
|
||||
|
||||
if outer_result is not None:
|
||||
inner_result = r.get("result", {}).get("result")
|
||||
if inner_result is not None and Helpers.code_check(r):
|
||||
|
Loading…
x
Reference in New Issue
Block a user