Skip to content

Commit

Permalink
Merge pull request #418 from Barma-lej/dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Barma-lej authored Oct 9, 2024
2 parents c2bc316 + 6fd4cc8 commit 697862f
Showing 1 changed file with 10 additions and 100 deletions.
110 changes: 10 additions & 100 deletions src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,106 +18,16 @@ export function isObject(obj) {
*/
export function wifiStrenghtToQuality(rssi) {
const qualtable = {
1: 100,
2: 100,
3: 100,
4: 100,
5: 100,
6: 100,
7: 100,
8: 100,
9: 100,
10: 100,
11: 100,
12: 100,
13: 100,
14: 100,
15: 100,
16: 100,
17: 100,
18: 100,
19: 100,
20: 100,
21: 99,
22: 99,
23: 99,
24: 98,
25: 98,
26: 98,
27: 97,
28: 97,
29: 96,
30: 96,
31: 95,
32: 95,
33: 94,
34: 93,
35: 93,
36: 92,
37: 91,
38: 90,
39: 90,
40: 89,
41: 88,
42: 87,
43: 86,
44: 85,
45: 84,
46: 83,
47: 82,
48: 81,
49: 80,
50: 79,
51: 78,
52: 76,
53: 75,
54: 74,
55: 73,
56: 71,
57: 70,
58: 69,
59: 67,
60: 66,
61: 64,
62: 63,
63: 61,
64: 60,
65: 58,
66: 56,
67: 55,
68: 53,
69: 51,
70: 50,
71: 48,
72: 46,
73: 44,
74: 42,
75: 40,
76: 38,
77: 36,
78: 34,
79: 32,
80: 30,
81: 28,
82: 26,
83: 24,
84: 22,
85: 20,
86: 17,
87: 15,
88: 13,
89: 10,
90: 8,
91: 6,
92: 3,
93: 1,
94: 1,
95: 1,
96: 1,
97: 1,
98: 1,
99: 1,
100: 1,
1: 100, 2: 100, 3: 100, 4: 100, 5: 100, 6: 100, 7: 100, 8: 100, 9: 100,
10: 100, 11: 100, 12: 100, 13: 100, 14: 100, 15: 100, 16: 100, 17: 100, 18: 100, 19: 100,
20: 100, 21: 99, 22: 99, 23: 99, 24: 98, 25: 98, 26: 98, 27: 97, 28: 97, 29: 96,
30: 96, 31: 95, 32: 95, 33: 94, 34: 93, 35: 93, 36: 92, 37: 91, 38: 90, 39: 90,
40: 89, 41: 88, 42: 87, 43: 86, 44: 85, 45: 84, 46: 83, 47: 82, 48: 81, 49: 80,
50: 79, 51: 78, 52: 76, 53: 75, 54: 74, 55: 73, 56: 71, 57: 70, 58: 69,59: 67,
60: 66, 61: 64, 62: 63, 63: 61, 64: 60, 65: 58, 66: 56, 67: 55, 68: 53, 69: 51,
70: 50, 71: 48, 72: 46, 73: 44, 74: 42, 75: 40, 76: 38, 77: 36, 78: 34, 79: 32,
80: 30, 81: 28, 82: 26, 83: 24, 84: 22, 85: 20, 86: 17, 87: 15, 88: 13, 89: 10,
90: 8, 91: 6,92: 3, 93: 1, 94: 1, 95: 1, 96: 1, 97: 1, 98: 1, 99: 1, 100: 1,
};
return rssi < 0 && rssi > -101 ? qualtable[Math.abs(rssi)] + ' %' : 0;
}

0 comments on commit 697862f

Please sign in to comment.