1 """Summary binary data from Nextcoud."""
3 from __future__
import annotations
5 from typing
import Final
9 BinarySensorEntityDescription,
15 from .
import NextcloudConfigEntry
16 from .entity
import NextcloudEntity
18 BINARY_SENSORS: Final[list[BinarySensorEntityDescription]] = [
21 translation_key=
"nextcloud_jit_enabled",
22 entity_category=EntityCategory.DIAGNOSTIC,
23 entity_registry_enabled_default=
False,
27 translation_key=
"nextcloud_jit_on",
28 entity_category=EntityCategory.DIAGNOSTIC,
29 entity_registry_enabled_default=
False,
33 translation_key=
"nextcloud_system_debug",
34 entity_category=EntityCategory.DIAGNOSTIC,
37 key=
"system_enable_avatars",
38 translation_key=
"nextcloud_system_enable_avatars",
39 entity_category=EntityCategory.DIAGNOSTIC,
42 key=
"system_enable_previews",
43 translation_key=
"nextcloud_system_enable_previews",
44 entity_category=EntityCategory.DIAGNOSTIC,
47 key=
"system_filelocking.enabled",
48 translation_key=
"nextcloud_system_filelocking_enabled",
49 entity_category=EntityCategory.DIAGNOSTIC,
56 entry: NextcloudConfigEntry,
57 async_add_entities: AddEntitiesCallback,
59 """Set up the Nextcloud binary sensors."""
60 coordinator = entry.runtime_data
63 for sensor
in BINARY_SENSORS
64 if sensor.key
in coordinator.data
69 """Represents a Nextcloud binary sensor."""
73 """Return true if the binary sensor is on."""
75 return val
is True or val ==
"yes"
None async_setup_entry(HomeAssistant hass, NextcloudConfigEntry entry, AddEntitiesCallback async_add_entities)