Skip to content

Commit d01144f

Browse files
committed
add MAC address to info output; fix naming convention
1 parent dff5136 commit d01144f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ Topic: co2-meter/`{device ID}`/out/`{command}`
9696
| network.wifiQuality | quality of signal strength (value between 0 and 100%) | number |
9797
| network.wifiSsid | SSID of connected wifi | string |
9898
| network.ip | ip address of the module | string |
99+
| network.mac | MAC address of the device | string |
99100
| co2.isPreheating | TRUE if the sensor is preheated | boolean |
100101
| co2.temperature | temperature from sensor (in °C) | number |
101102
| co2.ppm | CO2 concentration in the air (in ppm) | number |

src/main.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ void onWiFiEvent(WiFiEvent_t event)
110110
}
111111
}
112112

113-
int GetRssiAsQuality(int rssi)
113+
int getRssiAsQuality(int rssi)
114114
{
115115
int quality = 0;
116116

@@ -151,9 +151,10 @@ DynamicJsonDocument getInfoJson()
151151
JsonObject network = doc.createNestedObject("network");
152152
int8_t rssi = WiFi.RSSI();
153153
network["wifiRssi"] = rssi;
154-
network["wifiQuality"] = GetRssiAsQuality(rssi);
154+
network["wifiQuality"] = getRssiAsQuality(rssi);
155155
network["wifiSsid"] = WiFi.SSID();
156156
network["ip"] = WiFi.localIP().toString();
157+
network["mac"] = WiFi.macAddress();
157158

158159
// CO2 meter
159160
JsonObject co2Meter = doc.createNestedObject("co2");

0 commit comments

Comments
 (0)