Skip to content
Snippets Groups Projects
Commit 782713ee authored by Paulus Schoutsen's avatar Paulus Schoutsen
Browse files

Merge pull request #1398 from GreenTurtwig/steam

Update Steam sensor to show currently played game
parents dd45b5e0 393df2da
No related branches found
No related tags found
No related merge requests found
......@@ -49,6 +49,10 @@ class SteamSensor(Entity):
def update(self):
"""Update device state."""
self._profile = self._steamod.user.profile(self._account)
if self._profile.current_game[2] is None:
self._game = 'None'
else:
self._game = self._profile.current_game[2]
self._state = {
1: 'Online',
2: 'Busy',
......@@ -58,6 +62,11 @@ class SteamSensor(Entity):
6: 'Play',
}.get(self._profile.status, 'Offline')
@property
def device_state_attributes(self):
"""Returns the state attributes."""
return {'Game': self._game}
@property
def entity_picture(self):
"""Avatar of the account."""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment