Skip to content

Commit

Permalink
Make distance property an integer. (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrstegeman committed Jun 21, 2019
1 parent e828091 commit d4bd8fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
@@ -1,7 +1,7 @@
{
"name": "earthquake-monitor-adapter",
"display_name": "Earthquake Monitor",
"version": "0.1.0",
"version": "0.1.1",
"description": "Earthquake monitor for Mozilla WebThings Gateway",
"author": "Mozilla IoT",
"main": "main.py",
Expand Down
4 changes: 2 additions & 2 deletions pkg/earthquake_monitor_device.py
Expand Up @@ -68,7 +68,7 @@ def __init__(self, adapter, _id, name, latitude, longitude, radius,
'distance',
{
'label': 'Distance',
'type': 'number',
'type': 'integer',
'unit': 'kilometer',
'readOnly': True,
},
Expand Down Expand Up @@ -126,7 +126,7 @@ def poll(self):
if delta < datetime.timedelta(minutes=self.active_interval):
self.properties['earthquake'].update(True)
self.properties['magnitude'].update(latest.magnitude)
self.properties['distance'].update(latest.distance_to_home)
self.properties['distance'].update(round(latest.distance_to_home))
self.properties['time'].update(str(latest.time).split('.')[0])
self.properties['place'].update(latest.place)
else:
Expand Down

0 comments on commit d4bd8fd

Please sign in to comment.