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

HA: discovery fixes #1969

Merged
merged 6 commits into from
Nov 9, 2019
Merged

HA: discovery fixes #1969

merged 6 commits into from
Nov 9, 2019

Conversation

mcspr
Copy link
Collaborator

@mcspr mcspr commented Nov 1, 2019

  • create object for each specialized discovery function to avoid accidentally sharing data (adjusted fix from Fix HA sensor discovery with MQTT #1957 @kiddouk )
  • update mqtt discovery mechanism to enqueue topic+message pairs instead of directly sending them. most noticeable when using low-memory lwip or when just starting up the board, mqtt messages will fill the buffer and end up being lost. enqueue them manually ourselves and send one by one
  • update mqttSendRaw to return whether sending succeeds (PID > 0)
  • update mqttSendRaw to log only small messages, avoid breaking ws / telnet debug queues with ha discovery payloads
  • small update to ws debug struct to also use std::pair<String, String>
  • fix (again) discovery not sending on reconnection; send flag will now reset to "enabled" value
    resolves Espurna device unavailable in Homeassistant integration after restart from HS #1637

also supersedes #1370 (almost happy 1y anniversary)

@mcspr mcspr merged commit 99dcff3 into xoseperez:dev Nov 9, 2019
@mcspr mcspr deleted the ha/disc-queue branch November 9, 2019 01:31
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.

Espurna device unavailable in Homeassistant integration after restart from HS
1 participant