[device_tracker.gpslogger] Add additional activity attribute.

pull/4846/head
Lewis Juggins 2016-12-11 09:05:56 +00:00
parent 7ba25f3526
commit cdf9464698
1 changed files with 3 additions and 0 deletions

View File

@ -63,6 +63,7 @@ class GPSLoggerView(HomeAssistantView):
accuracy = int(float(data['accuracy']))
if 'battery' in data:
battery = float(data['battery'])
attrs = {}
if 'speed' in data:
attrs['speed'] = float(data['speed'])
@ -72,6 +73,8 @@ class GPSLoggerView(HomeAssistantView):
attrs['altitude'] = float(data['altitude'])
if 'provider' in data:
attrs['provider'] = data['provider']
if 'activity' in data:
attrs['activity'] = data['activity']
yield from hass.loop.run_in_executor(
None, partial(self.see, dev_id=device,