mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 16:57:53 +00:00
Code optimization for UptimeRobot binary (#142986)
This commit is contained in:
parent
f2fa583101
commit
759d8a3f90
@ -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)
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user