mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 09:17:10 +00:00
Add the Gamerscore and Tier of the account (#12867)
* Added the Gamerscore and Tier of the account. The tier is the subscription type of the Xbox Live account, so Silver (which is now called Free) or Gold (paid). * Don't add the gamerscore and tier inside of the loop, since they're always the same.
This commit is contained in:
parent
ba20ffdde7
commit
2321603eb7
@ -69,7 +69,9 @@ class XboxSensor(Entity):
|
||||
if profile.get('success', True) and profile.get('code') is None:
|
||||
self.success_init = True
|
||||
self._gamertag = profile.get('gamertag')
|
||||
self._gamerscore = profile.get('gamerscore')
|
||||
self._picture = profile.get('gamerpicSmallSslImagePath')
|
||||
self._tier = profile.get('tier')
|
||||
else:
|
||||
_LOGGER.error("Can't get user profile %s. "
|
||||
"Error Code: %s Description: %s",
|
||||
@ -92,6 +94,9 @@ class XboxSensor(Entity):
|
||||
def device_state_attributes(self):
|
||||
"""Return the state attributes."""
|
||||
attributes = {}
|
||||
attributes['gamerscore'] = self._gamerscore
|
||||
attributes['tier'] = self._tier
|
||||
|
||||
for device in self._presence:
|
||||
for title in device.get('titles'):
|
||||
attributes[
|
||||
|
Loading…
x
Reference in New Issue
Block a user