Skip to content

Commit f9a8107

Browse files
committed
wifi-heatmap - accept either title or filename as argument
1 parent a3933ea commit f9a8107

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Changelog
77
* Fix heatmap generation error if ``wifi-survey`` is run with ``-S`` / ``--no-scan`` option to disable ``iwlist scan``.
88
* Implement ``-b`` / ``--bssid`` option to ensure that scan is against a specified BSSID.
99
* Implement ``--ding`` option to play a short audio file (i.e. a ding) when measurement is finished.
10+
* ``wifi-heatmap`` - accept either title or filename as argument
1011

1112
0.2.0 (2020-08-09)
1213
------------------

wifi_survey_heatmap/heatmap.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,8 @@ def __init__(self, image_path, title, ignore_ssids=[], aps=None):
136136
}
137137
self._image_path = image_path
138138
self._title = title
139+
if not self._title.endswith('.json'):
140+
self._title += '.json'
139141
self._ignore_ssids = ignore_ssids
140142
logger.debug(
141143
'Initialized HeatMapGenerator; image_path=%s title=%s',
@@ -152,7 +154,7 @@ def __init__(self, image_path, title, ignore_ssids=[], aps=None):
152154
'Loaded image with width=%d height=%d',
153155
self._image_width, self._image_height
154156
)
155-
with open('%s.json' % self._title, 'r') as fh:
157+
with open(self._title, 'r') as fh:
156158
self._data = json.loads(fh.read())
157159
logger.info('Loaded %d measurement points', len(self._data))
158160

0 commit comments

Comments
 (0)