File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ Topic: co2-meter/`{device ID}`/in/`{command}`
70
70
| ---------- | ------------------------------------------------------------------------------------------ | -------------------- |
71
71
| sleep | Start deep-sleep for specific duration (in seconds!) | { duration: number } |
72
72
| info | Send info via MQTT topic ` co2-meter/out/info ` package | - |
73
+ | display | turn display on/off | { on: boolean } |
73
74
| hard-reset | Reset config with WiFi and MQTT settings and start internal hotspot to reconfigure device. | - |
74
75
75
76
### Outcoming commands
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ extern "C"
24
24
#define DEVICE_ID (Sprintf(" %06" PRIx64, ESP.getEfuseMac() >> 24 )) // unique device ID
25
25
#define uS_TO_S_FACTOR 1000000 // Conversion factor for micro seconds to seconds
26
26
27
- String version = " 0.1 .0" ;
27
+ String version = " 1.0 .0" ;
28
28
29
29
AsyncMqttClient mqttClient;
30
30
@@ -240,6 +240,13 @@ void processingMessage(String channel, DynamicJsonDocument doc)
240
240
unsigned long seconds = doc[" duration" ].as <unsigned long >();
241
241
goSleep (seconds);
242
242
}
243
+ else if (channel.equals (" display" ))
244
+ {
245
+ bool turnOn = doc[" on" ].as <bool >();
246
+ uint8_t command = turnOn ? SSD1306_DISPLAYON : SSD1306_DISPLAYOFF;
247
+
248
+ display.ssd1306_command (command);
249
+ }
243
250
else if (channel.equals (" hard-reset" ))
244
251
{
245
252
hardReset ();
You can’t perform that action at this time.
0 commit comments