Code optimization for UptimeRobot binary (#142986)

This commit is contained in:
Simone Chemelli 2025-04-15 12:07:48 +02:00 committed by GitHub
parent f2fa583101
commit 759d8a3f90
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 1 additions and 6 deletions

View File

@ -43,4 +43,4 @@ class UptimeRobotBinarySensor(UptimeRobotEntity, BinarySensorEntity):
@property
def is_on(self) -> bool:
"""Return True if the entity is on."""
return self.monitor_available
return bool(self.monitor.status == 2)

View File

@ -59,8 +59,3 @@ class UptimeRobotEntity(CoordinatorEntity[UptimeRobotDataUpdateCoordinator]):
),
self._monitor,
)
@property
def monitor_available(self) -> bool:
"""Returtn if the monitor is available."""
return bool(self.monitor.status == 2)