SignalK / SensESP

Universal Signal K sensor framework for the ESP32 platform
https://signalk.org/SensESP/
Apache License 2.0
153 stars 81 forks source link

SensESP's WebUI upgrade vol. 2 #551

Closed JohnySeven closed 2 years ago

JohnySeven commented 2 years ago

So this is my 2nd pull request with few enhancements in WebUI area.

This PR add new features and enhances few things in WebUI:

  1. Status page was little messy so after talk with @mairas we're introducing UIOutput supports Groups! There few default groups or you can create your own. Here is example:

    auto customUIOutput = new UIOutput<int>("UserInfo", "My cool group");
    
    app.onRepeat(1000, [customUIOutput]()
    {
    int value = customUIOutput->get()+1;
    customUIOutput->set(value);
    });
  2. Renamed "Advanced" page to "Control" page and I've made few UI enhancements to introduce HTTP commands.
  3. HTTPCommand - new class that allows SensESP lib user to add custom commands on "Control" page, user can provide name, button label and define if WebUI should ask user to run command. Then in main.cpp user can add any command easily, here is example:
    sensesp_app->get_http_server()->add_command("On", "Turn on", false)
    ->attach([]()
    {
    pwm_value = on_value;
    });
  4. In last WebUI PR there was house logo on page, this PR brings SensESP logo!
  5. I've added new virtual method into Configurable class virtual String get_config_description() for returning configurable description that will be visible in configuration page.

Screenshots: screenshot-2022-02-08-19-33-43 screenshot-2022-02-08-19-34-39 image

Jan

mairas commented 2 years ago

The new features and changes are pretty great, and I can't wait to have them in SensESP!

In the PR description you listed five different unrelated new features or changes. To give me a fighting chance of reviewing the PR contents, would it be too much to ask if you re-submitted all those list items as five individual PRs? It is just so much easier to go through PRs that are about one single topic.

Also, please verify that the variable and class naming conforms to the Google C++ Style Guide and reformat the files.

mairas commented 2 years ago

Recapping an offline discussion: the PR will be reviewed without breaking it up.

Before I start the review, please double-check that variable naming in the C++ code conforms to the Google C++ Style Guide. Also, reformat the files and clean up the Git commits.

JohnySeven commented 2 years ago

Thanks! Will do and let you know!

JohnySeven commented 2 years ago

I'm currently unable to finish this PR due less free time - will do it later this month maybe.