Skip to content

Commit 84d73dd

Browse files
authored
Merge pull request #1 from OctoPrint/master
Merging fix in display of WLAN quality
2 parents a3556f5 + 466eb9b commit 84d73dd

File tree

3 files changed

+11
-6
lines changed

3 files changed

+11
-6
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
---
2+
3+
Provided as-is, currently not actively maintained.
4+
5+
[OctoPrint](http://octoprint.org) is eating up too much of my time and I don't find myself at liberty to actively maintain this project for the foreseeable future. If it works for you, great. If it doesn't, sorry, I can't look into it.
6+
7+
---
8+
19
# netconnectd plugin for OctoPrint
210

311
![netconnectd plugin: Overview with list of available wifis](https://i.imgur.com/Yjmxypvl.png)

octoprint_netconnectd/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def on_api_get(self, request):
7979
else:
8080
wifis = []
8181
except Exception as e:
82-
return jsonify(dict(error=e.message))
82+
return jsonify(dict(error=str(e)))
8383

8484
return jsonify(dict(
8585
wifis=wifis,
@@ -235,7 +235,7 @@ def _send_message(self, message, data):
235235
return False, output
236236

237237
except Exception as e:
238-
output = "Error while talking to netconnectd: {}".format(e.message)
238+
output = "Error while talking to netconnectd: {}".format(e)
239239
self._logger.warn(output)
240240
return False, output
241241

octoprint_netconnectd/static/js/netconnectd.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,9 +208,6 @@ $(function() {
208208
var qualityInt = parseInt(wifi.quality);
209209
var quality = undefined;
210210
if (!isNaN(qualityInt)) {
211-
if (qualityInt <= 0) {
212-
qualityInt = (-1) * qualityInt;
213-
}
214211
quality = qualityInt;
215212
}
216213

@@ -219,7 +216,7 @@ $(function() {
219216
address: wifi.address,
220217
encrypted: wifi.encrypted,
221218
quality: quality,
222-
qualityText: (quality != undefined) ? "" + quality + "%" : undefined
219+
qualityText: (quality != undefined) ? "" + quality + " dBm" : undefined
223220
});
224221
});
225222

0 commit comments

Comments
 (0)