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

"components should block" #8

Open
optimismus opened this issue Oct 19, 2023 · 1 comment
Open

"components should block" #8

optimismus opened this issue Oct 19, 2023 · 1 comment

Comments

@optimismus
Copy link
Contributor

This is inside my ESP logging:
[20:34:41][D][luxtronik_v1:116]: S: 1200 - 0 [20:34:41][W][component:204]: Component <unknown> took a long time for an operation (0.14 s). [20:34:41][W][component:205]: Components should block for at most 20-30ms. [20:34:41][D][luxtronik_v1:212]: 1200 found -> Inputs

I think the ESP need some time to work with the results?! May be there should be a little pause between the calls?

@cbrosius
Copy link
Owner

cbrosius commented Nov 1, 2023

Yes this is a warning, that is shown now by ESPHome since 2023.7.0
There is an issue (esphome/issues#4717) in the esphome-git for this already open.

`And here, basically we have two choices:

The sensor requires a nudge to send back the value over the bus:
in update() we write the "update_me" command, we return
in loop() we read the response and publish the requested sensors as we receive them, if the sensor requires more command for the other server, we send the command after each read(). We need a local buffer to cover those responses. And state tracking
The sensor streams value:
in loop(): we read values and update local variables
in update(): we publish the values we have available.
Unfortunately this won't solve the case of eInk displays. There is no way current technology would refresh a screen in 30ms. That is an entirely different matter. In general with the stream approach you need to fall back to continuations. Anyone who has used JavaScript before Promise knows where that staircase will eventually lead.`

Maybe we can try to include some update() lines in the loop()-codepart.

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