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