mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 08:17:08 +00:00
Update steam_online.py
This commit is contained in:
parent
a54986159c
commit
393df2da49
@ -49,7 +49,10 @@ 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)
|
||||||
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 = {
|
self._state = {
|
||||||
1: 'Online',
|
1: 'Online',
|
||||||
2: 'Busy',
|
2: 'Busy',
|
||||||
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user