Skip to content

Commit

Permalink
unwrap the response
Browse files Browse the repository at this point in the history
  • Loading branch information
rytilahti committed Jul 14, 2020
1 parent 98f9193 commit 35f9736
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions miio/vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def locale(self):
@command()
def timezone(self):
"""Get the timezone."""
res = self.send("get_timezone")
res = self.send("get_timezone")[0]
if isinstance(res, dict):
# Xiaowa E25 example
# {'olson': 'Europe/Berlin', 'posix': 'CET-1CEST,M3.5.0,M10.5.0/3'}
Expand All @@ -550,7 +550,7 @@ def timezone(self):
return res["olson"]

# Gen1 vacuum: ['Europe/Berlin']
return res[0]
return res

def set_timezone(self, new_zone):
"""Set the timezone."""
Expand Down

0 comments on commit 35f9736

Please sign in to comment.