diff --git a/homeassistant/components/sensor/steam_online.py b/homeassistant/components/sensor/steam_online.py index d0f2e8b8c22bf79e8380b241832584a262c804b3..3ba7b2a0d9237ce54ef091f77a5dd6aa4666d5e3 100644 --- a/homeassistant/components/sensor/steam_online.py +++ b/homeassistant/components/sensor/steam_online.py @@ -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."""