How to use the androidtv.constants.CMD_SCREEN_ON 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_firetv_sync.py View on Github external
def test_turn_on_off(self):
        """Test that the ``FireTVSync.turn_on`` and ``FireTVSync.turn_off`` methods work correctly.

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

            self.ftv.turn_off()
            self.assertEqual(getattr(self.ftv._adb, self.ADB_ATTR).shell_cmd, constants.CMD_SCREEN_ON + " && input keyevent {0}".format(constants.KEY_SLEEP))
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 / androidtv / androidtv_sync.py View on Github external
def turn_on(self):
        """Send ``POWER`` action if the device is off."""
        self._adb.shell(constants.CMD_SCREEN_ON + " || input keyevent {0}".format(constants.KEY_POWER))
github JeffLIrion / python-androidtv / androidtv / firetv / firetv_async.py View on Github external
async def turn_on(self):
        """Send ``POWER`` and ``HOME`` actions if the device is off."""
        await self._adb.shell(constants.CMD_SCREEN_ON + " || (input keyevent {0} && input keyevent {1})".format(constants.KEY_POWER, constants.KEY_HOME))
github JeffLIrion / python-androidtv / androidtv / firetv / firetv_sync.py View on Github external
def turn_on(self):
        """Send ``POWER`` and ``HOME`` actions if the device is off."""
        self._adb.shell(constants.CMD_SCREEN_ON + " || (input keyevent {0} && input keyevent {1})".format(constants.KEY_POWER, constants.KEY_HOME))
github JeffLIrion / python-androidtv / androidtv / basetv / basetv_async.py View on Github external
async def screen_on(self):
        """Check if the screen is on.

        Returns
        -------
        bool
            Whether or not the device is on

        """
        return await self._adb.shell(constants.CMD_SCREEN_ON + constants.CMD_SUCCESS1_FAILURE0) == '1'
github JeffLIrion / python-androidtv / androidtv / basetv / basetv_sync.py View on Github external
def screen_on(self):
        """Check if the screen is on.

        Returns
        -------
        bool
            Whether or not the device is on

        """
        return self._adb.shell(constants.CMD_SCREEN_ON + constants.CMD_SUCCESS1_FAILURE0) == '1'
github JeffLIrion / python-androidtv / androidtv / androidtv / androidtv_async.py View on Github external
async def turn_off(self):
        """Send ``POWER`` action if the device is not off."""
        await self._adb.shell(constants.CMD_SCREEN_ON + " && input keyevent {0}".format(constants.KEY_POWER))