File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
homeassistant/components/starlink Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -75,7 +75,9 @@ def native_value(self) -> datetime:
7575 new_value = super ().native_value
7676 if TYPE_CHECKING :
7777 assert isinstance (new_value , datetime )
78- if not self ._attr_native_value or self ._attr_native_value < new_value :
78+ if not self ._attr_native_value or (
79+ self ._attr_native_value + timedelta (minutes = 1 ) < new_value
80+ ):
7981 self ._attr_native_value = new_value
8082 return self ._attr_native_value
8183
@@ -166,9 +168,7 @@ async def async_added_to_hass(self) -> None:
166168 translation_key = "last_boot_time" ,
167169 device_class = SensorDeviceClass .TIMESTAMP ,
168170 entity_category = EntityCategory .DIAGNOSTIC ,
169- value_fn = lambda data : (
170- now () - timedelta (seconds = data .status ["uptime" ], milliseconds = - 500 )
171- ).replace (microsecond = 0 ),
171+ value_fn = lambda data : now () - timedelta (seconds = data .status ["uptime" ]),
172172 entity_class = StarlinkLastRestartSensor ,
173173 ),
174174 StarlinkSensorEntityDescription (
You can’t perform that action at this time.
0 commit comments