Use shorthand attributes in Syncthru (#99884)

This commit is contained in:
Joost Lekkerkerker 2023-09-08 01:15:58 +02:00 committed by GitHub
parent a3d6c6192e
commit 9e8a8012df
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -109,6 +109,8 @@ class SyncThruMainSensor(SyncThruSensor):
the displayed current status message. the displayed current status message.
""" """
_attr_entity_registry_enabled_default = False
def __init__(self, coordinator: DataUpdateCoordinator[SyncThru], name: str) -> None: def __init__(self, coordinator: DataUpdateCoordinator[SyncThru], name: str) -> None:
"""Initialize the sensor.""" """Initialize the sensor."""
super().__init__(coordinator, name) super().__init__(coordinator, name)
@ -126,11 +128,6 @@ class SyncThruMainSensor(SyncThruSensor):
"display_text": self.syncthru.device_status_details(), "display_text": self.syncthru.device_status_details(),
} }
@property
def entity_registry_enabled_default(self) -> bool:
"""Disable entity by default."""
return False
class SyncThruTonerSensor(SyncThruSensor): class SyncThruTonerSensor(SyncThruSensor):
"""Implementation of a Samsung Printer toner sensor platform.""" """Implementation of a Samsung Printer toner sensor platform."""