Skip to content

Commit

Permalink
Fix serial number reporting for some devices, add locale command
Browse files Browse the repository at this point in the history
  • Loading branch information
rytilahti committed Nov 13, 2018
1 parent a86dc9f commit ba47efd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion miio/vacuum.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,15 @@ def test_sound_volume(self):
@command()
def serial_number(self):
"""Get serial number."""
return self.send("get_serial_number")[0]["serial_number"]
serial = self.send("get_serial_number")
if isinstance(serial, list):
return serial[0]["serial_number"]
return serial

@command()
def locale(self):
"""Return locale information."""
return self.send("app_get_locale")

@command()
def timezone(self):
Expand Down

0 comments on commit ba47efd

Please sign in to comment.