How to use the pyatv.convert.ms_to_s function in pyatv

To help you get started, we’ve selected a few pyatv 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 postlund / pyatv / tests / test_convert.py View on Github external
def test_time_in_seconds(self):
        self.assertEqual(0, convert.ms_to_s(400))
        self.assertEqual(1, convert.ms_to_s(501))
        self.assertEqual(36, convert.ms_to_s(36000))
github postlund / pyatv / tests / test_types.py View on Github external
def test_time_in_seconds(self):
        self.assertEqual(0, convert.ms_to_s(400))
        self.assertEqual(1, convert.ms_to_s(501))
        self.assertEqual(36, convert.ms_to_s(36000))
github postlund / pyatv / tests / test_types.py View on Github external
def test_invalid_time(self):
        # Sometimes really large times are reported during buffering, this test
        # handles those special cases.
        self.assertEqual(0, convert.ms_to_s(2**32 - 1))
github postlund / pyatv / tests / test_convert.py View on Github external
def test_no_time_returns_zero(self):
        self.assertEqual(0, convert.ms_to_s(None))
github postlund / pyatv / tests / test_convert.py View on Github external
def test_time_in_seconds(self):
        self.assertEqual(0, convert.ms_to_s(400))
        self.assertEqual(1, convert.ms_to_s(501))
        self.assertEqual(36, convert.ms_to_s(36000))
github postlund / pyatv / tests / test_types.py View on Github external
def test_time_in_seconds(self):
        self.assertEqual(0, convert.ms_to_s(400))
        self.assertEqual(1, convert.ms_to_s(501))
        self.assertEqual(36, convert.ms_to_s(36000))
github postlund / pyatv / tests / test_convert.py View on Github external
def test_invalid_time(self):
        # Sometimes really large times are reported during buffering, this test
        # handles those special cases.
        self.assertEqual(0, convert.ms_to_s(2**32 - 1))
github postlund / pyatv / pyatv / dmap / __init__.py View on Github external
def _get_time_in_seconds(self, tag):
        time = parser.first(self.playstatus, 'cmst', tag)
        return convert.ms_to_s(time)