From 2321603eb706745e20e70d156a3894a7f3ac38eb Mon Sep 17 00:00:00 2001 From: Kevin Tuhumury Date: Sun, 4 Mar 2018 02:38:51 +0100 Subject: [PATCH] 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. --- homeassistant/components/sensor/xbox_live.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/homeassistant/components/sensor/xbox_live.py b/homeassistant/components/sensor/xbox_live.py index 2fd1a66e790..0c7b8b48f62 100644 --- a/homeassistant/components/sensor/xbox_live.py +++ b/homeassistant/components/sensor/xbox_live.py @@ -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[