Repository navigation
Conversation
… encoding Capture the raw Android framebuffer gzip-compressed over ADB and encode the PNG on the host with the standard library. The device no longer spends seconds encoding PNG itself. Falls back to screencap -p when gzip or base64 is unavailable or the pixel format is unsupported. Corrupt or truncated data raises ScreencapError.
The new framebuffer screencap calibration and ADBPythonSync.shell_binary paths were uncovered, dropping total coverage on the PR branch below the master baseline. Add tests for pinned-method fallbacks, calibration with no valid candidate, big-endian RGB565 expansion, and shell_binary.
…e lint matrix The requirement was a bare `black`, so each CI Python resolved a different release (23.3.0 on 3.7 ... 26.10.1 on 3.10-3.12) and the newest normalizes androidtv/exceptions.py's module docstring value, which the repo's own formatting cannot absorb without a literal change. 23.3.0 is the newest release that still supports the maintained Python 3.7 leg and it leaves package, tests, and setup.py clean as authored.
On Python 3.7 unittest.mock.AsyncMock is unavailable, so the fallback AsyncMock subclass returned the coroutine from __call__ without awaiting it. Await the result when side_effect is a coroutine function, matching the 3.8+ contract so async test patches resolve correctly. Document the 3.7 semantics in venv_requirements.txt. No runtime code changed; dependencies unchanged.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Android TVs with slow native PNG encoding,
adb_screencap()can time out before returning an image. A tested Android projector took 16.83 seconds to produce native PNG, compared with 2.24 seconds for gzip-compressed raw capture in the device-side comparison.Capture the raw framebuffer through gzip/base64 and encode PNG on the host, inside the existing synchronous and asynchronous
adb_screencap()APIs. The async decoder runs in an executor. Support RGBA, RGBX, RGB888, RGB565 and BGRA framebuffers with 12- or 16-byte headers; retain native capture when the tools or pixel format are unsupported. Corrupt or truncated image data returnsNonewithout disconnecting a healthy ADB transport; connection errors still propagate.Validation: 254 tests passed, 1 skipped. Coverage includes pixel formats, headers, malformed gzip/framebuffers, native fallback, async execution and transport errors. A read-only capture on the projector returned a 1920×1080 PNG, with decoded pixels identical to the raw framebuffer. End-to-end capture took 9.12 seconds and host encoding took 0.34 seconds; this does not establish that every capture fits Home Assistant's polling interval.