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}`
7070| ---------- | ------------------------------------------------------------------------------------------ | -------------------- |
7171| sleep | Start deep-sleep for specific duration (in seconds!) | { duration: number } |
7272| info | Send info via MQTT topic ` co2-meter/out/info ` package | - |
73+ | display | turn display on/off | { on: boolean } |
7374| hard-reset | Reset config with WiFi and MQTT settings and start internal hotspot to reconfigure device. | - |
7475
7576### Outcoming commands
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ extern "C"
2424#define DEVICE_ID (Sprintf(" %06" PRIx64, ESP.getEfuseMac() >> 24 )) // unique device ID
2525#define uS_TO_S_FACTOR 1000000 // Conversion factor for micro seconds to seconds
2626
27- String version = " 0.1 .0" ;
27+ String version = " 1.0 .0" ;
2828
2929AsyncMqttClient mqttClient;
3030
@@ -240,6 +240,13 @@ void processingMessage(String channel, DynamicJsonDocument doc)
240240 unsigned long seconds = doc[" duration" ].as <unsigned long >();
241241 goSleep (seconds);
242242 }
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+ }
243250 else if (channel.equals (" hard-reset" ))
244251 {
245252 hardReset ();
You can’t perform that action at this time.
0 commit comments