Skip to content
Snippets Groups Projects
Commit 308744d8 authored by Daniel Høyer Iversen's avatar Daniel Høyer Iversen Committed by Lewis Juggins
Browse files

Add additional attributes to GPSLogger (#4755)

parent 13006cee
No related branches found
No related tags found
No related merge requests found
......@@ -63,10 +63,20 @@ 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'])
if 'direction' in data:
attrs['direction'] = float(data['direction'])
if 'altitude' in data:
attrs['altitude'] = float(data['altitude'])
if 'provider' in data:
attrs['provider'] = data['provider']
yield from hass.loop.run_in_executor(
None, partial(self.see, dev_id=device,
gps=gps_location, battery=battery,
gps_accuracy=accuracy))
gps_accuracy=accuracy,
attributes=attrs))
return 'Setting location for {}'.format(device)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment