Skip to content

Use escape sequence \x1B to clear messenger widget #329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 2, 2022

Conversation

pennam
Copy link
Collaborator

@pennam pennam commented Jul 29, 2022

Following the discussion here: https://forum.arduino.cc/t/dashboard-messenger-widget-scroll-clear-window/696962/17

If \x1B is sent and the property is linked to a messenger widget all prior messages will be hidden in the dashboard. Since there is no knowledge in the library about the widget i though to wrap the const sting in a generig namespace called PropertyActions.

If the property is declared as CloudString there is also the possibility to send the escape sequence using .clear() method

CloudString message;
...
message.clear();
...

or

String message;
...
message = PropertyActions::CLEAR;
...

@pennam pennam requested a review from aentinger July 29, 2022 08:38
@codecov-commenter
Copy link

Codecov Report

Merging #329 (fd7fe26) into master (04f41b8) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master     #329   +/-   ##
=======================================
  Coverage   94.87%   94.87%           
=======================================
  Files          27       27           
  Lines        1113     1113           
=======================================
  Hits         1056     1056           
  Misses         57       57           
Impacted Files Coverage Δ
src/property/Property.cpp 88.60% <ø> (ø)
src/property/Property.h 88.88% <ø> (ø)
src/property/types/CloudString.h 100.00% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d771bd7...fd7fe26. Read the comment docs.

@github-actions
Copy link

Memory usage change @ fd7fe26

Board flash % RAM for global variables %
arduino:mbed:envie_m7 🔺 +8 - +72 0.0 - +0.01 🔺 +24 - +24 0.0 - 0.0
arduino:mbed_nano:nanorp2040connect 🔺 +46 - +46 0.0 - 0.0 🔺 +16 - +16 +0.01 - +0.01
arduino:mbed_nicla:nicla_vision 🔺 +64 - +72 0.0 - 0.0 🔺 +8 - +16 0.0 - 0.0
arduino:samd:mkr1000 🔺 +40 - +48 +0.02 - +0.02 🔺 +16 - +16 +0.05 - +0.05
arduino:samd:mkrgsm1400 🔺 +40 - +48 +0.02 - +0.02 🔺 +16 - +16 +0.05 - +0.05
arduino:samd:mkrnb1500 🔺 +40 - +56 +0.02 - +0.02 🔺 +16 - +32 +0.05 - +0.1
arduino:samd:mkrwan1300 🔺 +40 - +40 +0.02 - +0.02 🔺 +8 - +16 +0.02 - +0.05
arduino:samd:mkrwifi1010 🔺 +40 - +56 +0.02 - +0.02 🔺 +8 - +32 +0.02 - +0.1
arduino:samd:nano_33_iot 🔺 +44 - +52 +0.02 - +0.02 🔺 +12 - +20 +0.04 - +0.06
esp32:esp32:esp32 🔺 +36 - +64 0.0 - 0.0 🔺 +16 - +16 0.0 - 0.0
esp8266:esp8266:huzzah 🔺 +56 - +56 +0.01 - +0.01 🔺 +16 - +16 +0.02 - +0.02
Click for full report table
Board examples/ArduinoIoTCloud-Advanced
flash
% examples/ArduinoIoTCloud-Advanced
RAM for global variables
% examples/ArduinoIoTCloud-Basic
flash
% examples/ArduinoIoTCloud-Basic
RAM for global variables
% examples/utility/ArduinoIoTCloud_Travis_CI
flash
% examples/utility/ArduinoIoTCloud_Travis_CI
RAM for global variables
% examples/utility/Provisioning
flash
% examples/utility/Provisioning
RAM for global variables
% examples/utility/SelfProvisioning
flash
% examples/utility/SelfProvisioning
RAM for global variables
%
arduino:mbed:envie_m7 8 0.0 24 0.0 72 0.01 24 0.0 8 0.0 24 0.0 16 0.0 24 0.0
arduino:mbed_nano:nanorp2040connect 46 0.0 16 0.01 46 0.0 16 0.01 46 0.0 16 0.01 46 0.0 16 0.01 46 0.0 16 0.01
arduino:mbed_nicla:nicla_vision 64 0.0 16 0.0 72 0.0 8 0.0 72 0.0 8 0.0 64 0.0 16 0.0
arduino:samd:mkr1000 40 0.02 16 0.05 40 0.02 16 0.05 48 0.02 16 0.05 40 0.02 16 0.05
arduino:samd:mkrgsm1400 40 0.02 16 0.05 40 0.02 16 0.05 48 0.02 16 0.05 48 0.02 16 0.05
arduino:samd:mkrnb1500 56 0.02 32 0.1 40 0.02 16 0.05 48 0.02 16 0.05 40 0.02 16 0.05
arduino:samd:mkrwan1300 40 0.02 8 0.02 40 0.02 16 0.05 40 0.02 16 0.05
arduino:samd:mkrwifi1010 56 0.02 32 0.1 40 0.02 8 0.02 40 0.02 8 0.02 48 0.02 16 0.05 48 0.02 8 0.02
arduino:samd:nano_33_iot 44 0.02 20 0.06 44 0.02 12 0.04 44 0.02 12 0.04 52 0.02 20 0.06 52 0.02 12 0.04
esp32:esp32:esp32 36 0.0 16 0.0 64 0.0 16 0.0 40 0.0 16 0.0
esp8266:esp8266:huzzah 56 0.01 16 0.02 56 0.01 16 0.02 56 0.01 16 0.02
Click for full report CSV
Board,examples/ArduinoIoTCloud-Advanced<br>flash,%,examples/ArduinoIoTCloud-Advanced<br>RAM for global variables,%,examples/ArduinoIoTCloud-Basic<br>flash,%,examples/ArduinoIoTCloud-Basic<br>RAM for global variables,%,examples/utility/ArduinoIoTCloud_Travis_CI<br>flash,%,examples/utility/ArduinoIoTCloud_Travis_CI<br>RAM for global variables,%,examples/utility/Provisioning<br>flash,%,examples/utility/Provisioning<br>RAM for global variables,%,examples/utility/SelfProvisioning<br>flash,%,examples/utility/SelfProvisioning<br>RAM for global variables,%
arduino:mbed:envie_m7,8,0.0,24,0.0,72,0.01,24,0.0,8,0.0,24,0.0,16,0.0,24,0.0
arduino:mbed_nano:nanorp2040connect,46,0.0,16,0.01,46,0.0,16,0.01,46,0.0,16,0.01,46,0.0,16,0.01,46,0.0,16,0.01
arduino:mbed_nicla:nicla_vision,64,0.0,16,0.0,72,0.0,8,0.0,72,0.0,8,0.0,64,0.0,16,0.0,,,,
arduino:samd:mkr1000,40,0.02,16,0.05,40,0.02,16,0.05,48,0.02,16,0.05,40,0.02,16,0.05,,,,
arduino:samd:mkrgsm1400,40,0.02,16,0.05,40,0.02,16,0.05,48,0.02,16,0.05,48,0.02,16,0.05,,,,
arduino:samd:mkrnb1500,56,0.02,32,0.1,40,0.02,16,0.05,48,0.02,16,0.05,40,0.02,16,0.05,,,,
arduino:samd:mkrwan1300,40,0.02,8,0.02,40,0.02,16,0.05,40,0.02,16,0.05,,,,,,,,
arduino:samd:mkrwifi1010,56,0.02,32,0.1,40,0.02,8,0.02,40,0.02,8,0.02,48,0.02,16,0.05,48,0.02,8,0.02
arduino:samd:nano_33_iot,44,0.02,20,0.06,44,0.02,12,0.04,44,0.02,12,0.04,52,0.02,20,0.06,52,0.02,12,0.04
esp32:esp32:esp32,36,0.0,16,0.0,64,0.0,16,0.0,40,0.0,16,0.0,,,,,,,,
esp8266:esp8266:huzzah,56,0.01,16,0.02,56,0.01,16,0.02,56,0.01,16,0.02,,,,,,,,

@per1234 per1234 added type: enhancement Proposed improvement topic: code Related to content of the project itself labels Jul 31, 2022
@pennam pennam merged commit ec959ae into arduino-libraries:master Aug 2, 2022
@pennam pennam deleted the clear-widget branch May 17, 2024 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants