Skip to content

0.7.0

Choose a tag to compare

@iulianmac iulianmac released this 22 Nov 16:26
fba9546

This is the first release of the community fork with bug fixes. Home Assistant's Deako integration will move to it from 0.6.1 and calls the library the same way as before.

Fixes

  • Switching several lights at once now switches all of them. Requests went out back to back without the CRLF the bridge expects, so the bridge dropped some without an error, for example when a voice assistant turned on a whole room. Each request now ends with CRLF and waits for the bridge's answer to the previous one, and a DEVICE_BUSY answer is retried (#1).
  • When the bridge closed the connection, the read loop spun without yielding and froze Home Assistant's event loop. It now notices the closed socket and reconnects (#3).
  • After a dropped connection the library found the bridge again only after a reload, and logged "No devices to connect to" every 10 s until then (home-assistant/core#130546). It now reconnects on its own (#3).
  • A UTF-8 character split between two reads, an invalid line, a message that never ends, or unexpected values in device data no longer drop or block the connection (#3).
  • An unexpected error while connecting no longer stops later attempts, and cancelling a connect closes its socket (#3).

Other changes

  • Python 3.11 or newer is required (#6).
  • Exception names end in Error, as PEP 8 asks, for example DevicesNotFoundError. The old name DevicesNotFoundException still works (#4).
  • The wheel no longer contains the test modules (#4).
  • The package passes mypy --strict (#2).

For contributors

The tests now include a fake Deako bridge, discovery through a real zeroconf on loopback, a contract test for the calls Home Assistant makes, and a replay of a session recorded from a real bridge. Coverage is 100% and CI enforces it (#5). CI also runs Home Assistant's Deako integration on the library and tests the built wheel, and a release runs the whole CI before it publishes (#7). The README and docstrings were rewritten, and CONTRIBUTING and SECURITY files added (#6).

Known issues

Calling connect() twice leaves the first connection open, and calling disconnect() while connect() is still looking for a bridge doesn't stop the retries. Both bugs were already in 0.6.1, and each has a test marked xfail.

Full changelog: 0.6.1...0.7.0