Use native datetime value in IPP sensors (#60234)
This commit is contained in:
parent
af51aeb6dc
commit
2de0a14db0
1 changed files with 3 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
|||
"""Support for IPP sensors."""
|
||||
from __future__ import annotations
|
||||
|
||||
from datetime import timedelta
|
||||
from datetime import datetime, timedelta
|
||||
from typing import Any
|
||||
|
||||
from homeassistant.components.sensor import SensorEntity
|
||||
|
@ -187,7 +187,6 @@ class IPPUptimeSensor(IPPSensor):
|
|||
)
|
||||
|
||||
@property
|
||||
def native_value(self) -> str:
|
||||
def native_value(self) -> datetime:
|
||||
"""Return the state of the sensor."""
|
||||
uptime = utcnow() - timedelta(seconds=self.coordinator.data.info.uptime)
|
||||
return uptime.replace(microsecond=0).isoformat()
|
||||
return utcnow() - timedelta(seconds=self.coordinator.data.info.uptime)
|
||||
|
|
Loading…
Add table
Reference in a new issue