* Consequently ignore empty MQTT state payloads and set state to `unknown` on "None" payload
* Do not change preset mode behavior
* Add device tracker ignoring empty state
* Ignore empty state for lock
* Resolve merge errors
* Improve error logging on invalid MQTT entity state
* Explain not hanlding TpeError and ValueError
* Move length check closer to source
* use _LOGGER.exception
* Create bound callback_message_received method for handling mqtt callbacks
* refactor a bit
* fix ruff
* reduce overhead
* cleanup
* cleanup
* Revert changes alarm_control_panel
* Add sensor and binary sensor
* use same pattern for MqttAttributes/MqttAvailability
* remove useless function since we did not need to add to it
* code cleanup
* collapse
---------
Co-authored-by: J. Nick Koston <nick@koston.org>
* Reduce overhead to validate mqtt topics
valid_topic would iterate all the chars 4x, refactor to only
do it 1x
valid_subscribe_topic would enumerate all the chars when there was
no + in the string
* check if adding a cache helps
* tweak lrus based on testing stats
* note to future maintainers
* note to future maintainers
* keep standard lru_cache size as increasing makes no material difference
Borrows the same design from homeassistant.helpers.storage to avoid
rescheduling the timer every time async_schedule is called if a timer
is already running.
Instead of the timer fires too early it gets rescheduled for the time
we wanted it. This avoids 1000s of timer add/cancel during startup
* Increase MQTT broker socket buffer size
* Revert unrelated change
* Try to increase buffer size
* Set INITIAL_SUBSCRIBE_COOLDOWN back to 0.5 sec
* Sinplify and add test
* comments
* comments
---------
Co-authored-by: J. Nick Koston <nick@koston.org>
* Add title feature to notify entity platform
* Add overload variants
* Remove overloads, update signatures
* Improve test coverage
* Apply suggestions from code review
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Do not use const
* fix typo
---------
Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
* Fix MQTT discovery cooldown too short with large setup
* Set to 5 sec
* Only change the discovery cooldown
* Fire immediatly when teh debouncing period is over