Update steam_online.py

This commit is contained in:
Rowan Hine 2016-02-25 17:46:51 +00:00
parent a54986159c
commit 393df2da49

View File

@ -49,6 +49,9 @@ class SteamSensor(Entity):
def update(self): def update(self):
"""Update device state.""" """Update device state."""
self._profile = self._steamod.user.profile(self._account) 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._game = self._profile.current_game[2]
self._state = { self._state = {
1: 'Online', 1: 'Online',
@ -62,8 +65,6 @@ class SteamSensor(Entity):
@property @property
def device_state_attributes(self): def device_state_attributes(self):
"""Returns the state attributes.""" """Returns the state attributes."""
if self._game == None:
self._game = 'None'
return {'Game': self._game} return {'Game': self._game}
@property @property