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

Print each HA config entry separately #1535

Merged
merged 4 commits into from
Feb 10, 2019

Conversation

mcspr
Copy link
Collaborator

@mcspr mcspr commented Feb 8, 2019

Fixes #1233
Does involve sort-of a hack by knowing that DEBUG_MSG will not print timestamp if the last symbol is not new-line/cr-return.

code/espurna/homeassistant.ino Outdated Show resolved Hide resolved
@@ -317,6 +349,7 @@ void haSetup() {

// Main callbacks
espurnaRegisterReload(_haConfigure);
espurnaRegisterLoop(_haLoop);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it really worth it to have it being checked in the main loop all the time? Wouldn't it be better t use a ticker?

Copy link
Collaborator Author

@mcspr mcspr Feb 9, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One option is to make additional API for such one-off functions to not overuse Ticker. Somehing accepting std::function with bound args.
Also see #1370

And I forgot to add check if client is actually connected...

@@ -1366,7 +1367,9 @@ function processData(data) {
// -----------------------------------------------------------------------------

if ("haConfig" === key) {
$("#haConfig").show();
websock.send("{}");
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Speeding up Windows <-> ESP tcp exchange. Quite noticeable.
#1387 (comment)
#1300 (comment)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE: in case DEBUG_SUPPORT is enabled, client must send something back too in response to the "weblog". Otherwise, haConfig messages are stuck behind. Gosh darnit...

@xoseperez xoseperez merged commit 3b6c64c into xoseperez:dev Feb 10, 2019
@mcspr

This comment has been minimized.

@mcspr mcspr deleted the hass/stream-config branch February 11, 2019 17:53
@mcspr mcspr mentioned this pull request Feb 12, 2019
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

Successfully merging this pull request may close these issues.

2 participants