Skip to content

Commit

Permalink
add a couple of states, there are others as these are coming from upn…
Browse files Browse the repository at this point in the history
…p service, but considering the device is controlled mainly over upnp extending the support here is not a priority
  • Loading branch information
rytilahti committed Oct 29, 2017
1 parent e9d55e3 commit c481f1b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions miio/wifispeaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ def channel(self) -> str:
def state(self) -> str:
"""State of the device, e.g. PLAYING."""
# note: this can be enumized when all values are known
class PlayState:
Playing = "PLAYING"
Stopped = "STOPPED"
Paused = "PAUSED_PLAYBACK"

return self.data["current_state"]

@property
Expand Down Expand Up @@ -59,6 +64,10 @@ def track_duration(self) -> str:
def transport_channel(self) -> str:
"""Transport channel, e.g. PLAYLIST"""
# note: this can be enumized when all values are known
class TransportChannel:
Playlist = "PLAYLIST"
OneTime = "ONETIME"

return self.data["transport_channel"]


Expand Down

0 comments on commit c481f1b

Please sign in to comment.