JeffLIrion / python-androidtv

Communicate with an Android TV or Fire TV device via ADB over a network.
MIT License
170 stars 59 forks source link

Fix CMD_SCREEN_ON constant in accordance with #323 #325

Closed Victor4X closed 1 year ago

Victor4X commented 1 year ago

This implements the change mentioned in #323.

The original issue of not getting any information in HASS was caused by update() https://github.com/JeffLIrion/python-androidtv/blob/b1425b1b0d1d826e25948fad15ca3650433e3d5d/androidtv/androidtv/androidtv_async.py#L84 using the lazy parameter in get_properties(), which doesn't retrieve any information unless the screen is on: https://github.com/JeffLIrion/python-androidtv/blob/b1425b1b0d1d826e25948fad15ca3650433e3d5d/androidtv/androidtv/androidtv_async.py#L182

The change adds an additional way to check whether or not the screen is on, and should still function properly in older android versions.

More work is needed to determine the cause of periodic state:Off logs: https://github.com/JeffLIrion/python-androidtv/issues/323#issuecomment-1289326966

chatziko commented 1 year ago

@JeffLIrion : could you please publish a new pypi release containing this fix?

JeffLIrion commented 1 year ago

@chatziko done!

chatziko commented 1 year ago

@JeffLIrion : many thanks!