github IAsDoubleYou/ha_mysql v1.4.0
Async database driver (aiomysql) + optional TLS

latest releases: v2.2.1, v2.2.0, v2.1.0...
one month ago

Highlights

The database driver has been replaced with aiomysql, the same async driver mysql_query already uses. This closes a gap where a query that stopped getting answers after connecting could hold onto its pooled connection forever, eventually exhausting the whole pool.

Added

  • Encrypt the connection (TLS) — a new connection option (off by default) in both the initial setup and Change the database connection. When enabled, the integration verifies the session was actually encrypted instead of trusting the driver's silent fallback to plain text.

Changed

  • Replaced mysql-connector-python with aiomysql as the database driver. All database calls are now natively asynchronous instead of running in an executor thread.
  • The manual retry-with-pool-rebuild logic is gone; a dropped connection is now recovered the same way mysql_query does it (a ping-based reconnect, backed by the coordinator's own poll interval).
  • A single timeout now covers a whole query end to end — acquiring a pooled connection, reconnecting it if needed, and running the statement — instead of only bounding the initial handshake.

No action needed for existing installations: the new TLS option defaults to off and every other setting stays the same.

Full details: CHANGELOG.md

Don't miss a new ha_mysql release

NewReleases is sending notifications on new releases.