python-androidtv
python-androidtv copied to clipboard
FireTV (Integrated in Smart TV) Power On functionality
One of my main annoyances with this integration has been with powering on my device. The default is for the device to send the power button followed by home if it is off. https://github.com/JeffLIrion/python-androidtv/blob/a2a0f33e4091768cf3e7ed30cedbb6f85f308d53/androidtv/firetv/firetv_async.py#L177 and https://github.com/JeffLIrion/python-androidtv/blob/a2a0f33e4091768cf3e7ed30cedbb6f85f308d53/androidtv/firetv/firetv_sync.py#L177 this effectively breaks the television turning on the last input if it is configured to do so.
While this can easily be fixed by adding:
turn_on_command: "input keyevent 26"
to the configuration, in order to override the default... I was curious if it might be feasible to make the default functionality follow what the television settings are set to. This can be determined by:
adb shell settings get secure power_on_launch_mode
where
0 = home
1 = last input
I'm not really sure if there's anything being stored in this implementation that would determine that dynamically though.
thanks in advance.
It's probably possible to create a shell command that processes (i.e., greps) the output of that command and only sends the "home" button action if that's what the setting specifies.
But I think the complexity of doing so and making sure that it works as expected across all devices makes this not worthwhile, given that there's a simple means for users to customize the turn on/off commands.