mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 01:37:08 +00:00
Update wemo.py
This commit is contained in:
parent
e221c8a37d
commit
e9cf5f6f42
@ -157,7 +157,7 @@ class WemoSwitch(SwitchDevice):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def as_uptime(_seconds):
|
def as_uptime(_seconds):
|
||||||
"""Format seconds in to uptime string in the format: 00d 00h 00m 00s """
|
"""Format seconds into uptime string in the format: 00d 00h 00m 00s"""
|
||||||
uptime = datetime(1, 1, 1) + timedelta(seconds=_seconds)
|
uptime = datetime(1, 1, 1) + timedelta(seconds=_seconds)
|
||||||
return "{:0>2d}d {:0>2d}h {:0>2d}m {:0>2d}s".format(uptime.day-1,
|
return "{:0>2d}d {:0>2d}h {:0>2d}m {:0>2d}s".format(uptime.day-1,
|
||||||
uptime.hour,
|
uptime.hour,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user