diff --git a/homeassistant/components/sensor/steam_online.py b/homeassistant/components/sensor/steam_online.py index e65ffb20533ad930dd8dee53cc8005a4a3bee7b9..3ba7b2a0d9237ce54ef091f77a5dd6aa4666d5e3 100644 --- a/homeassistant/components/sensor/steam_online.py +++ b/homeassistant/components/sensor/steam_online.py @@ -49,7 +49,10 @@ class SteamSensor(Entity): def update(self): """Update device state.""" self._profile = self._steamod.user.profile(self._account) - self._game = self._profile.current_game[2] + 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', @@ -62,8 +65,6 @@ class SteamSensor(Entity): @property def device_state_attributes(self): """Returns the state attributes.""" - if self._game == None: - self._game = 'None' return {'Game': self._game} @property