I am working on a sensor project emulating a DS2450 1-wire device, which currently is not available in HA. The needed additions in components/onwire are done, tested and working, but the entity renaming is not working as expected.
The DS2450 emulation delivers e.g. 8 measurements:
volt.A ...volt.D and latestvolt.A .. latestvolt.D
Despite I have added the translation_key and placeholders according to the other templates, I can only get enumerated entitiy names, which is quite anoying.
How can I fix this issue ?
../components/onewire/const.py
DEVICE_KEYS_A_D = ("A", "B", "C", "D") DEVICE_SUPPORT = { "20": (),
../components/onewire/sensor.py
`from .const import (
DEVICE_KEYS_A_D,
"20": tuple(
[
OneWireSensorEntityDescription(
key=f"latestvolt.{device_key}",
device_class=SensorDeviceClass.VOLTAGE,
entity_registry_enabled_default=True,
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
read_mode=READ_MODE_FLOAT,
state_class=SensorStateClass.MEASUREMENT,
translation_key="latestvolt_id",
translation_placeholders={"id": str(device_key)},
)
for device_key in DEVICE_KEYS_A_D
]
+
[
OneWireSensorEntityDescription(
key=f"volt.{device_key}",
device_class=SensorDeviceClass.VOLTAGE,
entity_registry_enabled_default=True,
native_unit_of_measurement=UnitOfElectricPotential.VOLT,
read_mode=READ_MODE_FLOAT,
state_class=SensorStateClass.MEASUREMENT,
translation_key="volt_id",
translation_placeholders={"id": str(device_key)},
)
for device_key in DEVICE_KEYS_A_D
]
), `