Returns the date and time from the device. Return: str: The date and time
(self)
| 26 | class DeviceTime(CanExecuteCommands, CanExecuteScripts, CanRememberExtensionPresence): |
| 27 | @property |
| 28 | def device_time(self) -> str: |
| 29 | """Returns the date and time from the device. |
| 30 | |
| 31 | Return: |
| 32 | str: The date and time |
| 33 | """ |
| 34 | ext_name = 'mobile: getDeviceTime' |
| 35 | try: |
| 36 | return self.assert_extension_exists(ext_name).execute_script(ext_name) |
| 37 | except UnknownMethodException: |
| 38 | # TODO: Remove the fallback |
| 39 | return self.mark_extension_absence(ext_name).execute(Command.GET_DEVICE_TIME_GET, {})['value'] |
| 40 | |
| 41 | def get_device_time(self, format: Optional[str] = None) -> str: |
| 42 | """Returns the date and time from the device. |
nothing calls this directly
no test coverage detected