1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-27 23:52:28 +01:00

Unittests for esphome python code (#931)

This commit is contained in:
Tim Savage
2020-03-13 08:27:22 +11:00
committed by GitHub
parent 714d28a61a
commit c632b0e1d4
16 changed files with 1212 additions and 0 deletions

View File

@@ -143,6 +143,9 @@ class TimePeriod:
return f'{self.total_days}d'
return '0s'
def __repr__(self):
return f"TimePeriod<{self.total_microseconds}>"
@property
def total_microseconds(self):
return self.total_milliseconds * 1000 + (self.microseconds or 0)