Use translation placeholders in 1-Wire (#109120)

This commit is contained in:
Jan Rieger 2024-02-02 12:37:23 +01:00 committed by GitHub
parent cd1ef93123
commit a584429ce0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 108 additions and 231 deletions

View file

@ -38,7 +38,8 @@ DEVICE_BINARY_SENSORS: dict[str, tuple[OneWireBinarySensorEntityDescription, ...
key=f"sensed.{id}",
entity_registry_enabled_default=False,
read_mode=READ_MODE_BOOL,
translation_key=f"sensed_{id.lower()}",
translation_key="sensed_id",
translation_placeholders={"id": str(id)},
)
for id in DEVICE_KEYS_A_B
),
@ -47,7 +48,8 @@ DEVICE_BINARY_SENSORS: dict[str, tuple[OneWireBinarySensorEntityDescription, ...
key=f"sensed.{id}",
entity_registry_enabled_default=False,
read_mode=READ_MODE_BOOL,
translation_key=f"sensed_{id}",
translation_key="sensed_id",
translation_placeholders={"id": str(id)},
)
for id in DEVICE_KEYS_0_7
),
@ -56,7 +58,8 @@ DEVICE_BINARY_SENSORS: dict[str, tuple[OneWireBinarySensorEntityDescription, ...
key=f"sensed.{id}",
entity_registry_enabled_default=False,
read_mode=READ_MODE_BOOL,
translation_key=f"sensed_{id.lower()}",
translation_key="sensed_id",
translation_placeholders={"id": str(id)},
)
for id in DEVICE_KEYS_A_B
),
@ -72,7 +75,8 @@ HOBBYBOARD_EF: dict[str, tuple[OneWireBinarySensorEntityDescription, ...]] = {
read_mode=READ_MODE_BOOL,
entity_category=EntityCategory.DIAGNOSTIC,
device_class=BinarySensorDeviceClass.PROBLEM,
translation_key=f"hub_short_{id}",
translation_key="hub_short_id",
translation_placeholders={"id": str(id)},
)
for id in DEVICE_KEYS_0_3
),