How to use the androidtv.constants.KEY_POWER function in androidtv

To help you get started, we’ve selected a few androidtv examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github JeffLIrion / python-androidtv / tests / test_androidtv_sync.py View on Github external
def test_turn_on_off(self):
        """Test that the ``AndroidTVSync.turn_on`` and ``AndroidTVSync.turn_off`` methods work correctly.

        """
        with patchers.patch_connect(True)[self.PATCH_KEY], patchers.patch_shell('')[self.PATCH_KEY]:
            self.atv.turn_on()
            self.assertEqual(getattr(self.atv._adb, self.ADB_ATTR).shell_cmd, constants.CMD_SCREEN_ON + " || input keyevent {0}".format(constants.KEY_POWER))

            self.atv.turn_off()
            self.assertEqual(getattr(self.atv._adb, self.ADB_ATTR).shell_cmd, constants.CMD_SCREEN_ON + " && input keyevent {0}".format(constants.KEY_POWER))
github JeffLIrion / python-androidtv / androidtv / basetv / basetv_sync.py View on Github external
def power(self):
        """Send power action."""
        self._key(constants.KEY_POWER)
github JeffLIrion / python-androidtv / androidtv / androidtv / androidtv_async.py View on Github external
async def turn_on(self):
        """Send ``POWER`` action if the device is off."""
        await self._adb.shell(constants.CMD_SCREEN_ON + " || input keyevent {0}".format(constants.KEY_POWER))
github JeffLIrion / python-androidtv / androidtv / basetv / basetv_async.py View on Github external
async def power(self):
        """Send power action."""
        await self._key(constants.KEY_POWER)