Skip to content
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

Complete Example-Time Control is not working #248

Open
garudaonekh opened this issue Sep 1, 2023 · 4 comments
Open

Complete Example-Time Control is not working #248

garudaonekh opened this issue Sep 1, 2023 · 4 comments

Comments

@garudaonekh
Copy link

Hi
CompleteExample line 129:
mainTime = ESPUI.addControl(Time, "", "", None, 0, generalCallback);

In controls.js, it'll fire error unknown Event because Time is not recognized.

thanks

@iangray001
Copy link
Collaborator

Well it shouldn't do because it is in controls.js.

What, specifically, is the error?

@garudaonekh
Copy link
Author

garudaonekh commented Sep 1, 2023

In handlEvent function, there is no case for UI_TIME, so Line 605 is fired

@iangray001
Copy link
Collaborator

iangray001 commented Sep 1, 2023

Ah right, unless something has change in the meantime, you should notice that it still actually works though - it is just outputting an error incorrectly. I guess we never noticed it was outputting the message on the console log.

The TIME control doesn't actually need anything adding to the DOM, as you will see from looking in addToHTML(). The message can be silenced by adding another case here.

            case UI_GAUGE:
            case UI_SEPARATOR:
            case UI_TIME: 
                if (data.visible) addToHTML(data);
                break;

and then addToHTML will do nothing but there will also be no output on the console.

@iangray001 iangray001 reopened this Sep 1, 2023
@iangray001
Copy link
Collaborator

Note: Minor fix to merge in when someone gets a chance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants