Name unnamed binary sensors by their device class (#92940)
* Name unnamed binary sensors by their device class * Update type annotations * Fix loading of entity component translations * Add test * Update integrations * Set abode and rfxtrx binary_sensor name to None * Revert changes in homekit_controller
This commit is contained in:
parent
223394eaee
commit
2406b235b4
27 changed files with 287 additions and 47 deletions
|
@ -48,7 +48,7 @@ from homeassistant.exceptions import HomeAssistantError
|
|||
from homeassistant.helpers import entity_platform
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import StateType
|
||||
from homeassistant.helpers.typing import UNDEFINED, StateType
|
||||
|
||||
from .const import (
|
||||
ATTR_METER_TYPE,
|
||||
|
@ -610,7 +610,7 @@ class ZwaveSensor(ZWaveBaseEntity, SensorEntity):
|
|||
|
||||
# Entity class attributes
|
||||
self._attr_force_update = True
|
||||
if not entity_description.name:
|
||||
if not entity_description.name or entity_description.name is UNDEFINED:
|
||||
self._attr_name = self.generate_name(include_value_name=True)
|
||||
|
||||
@property
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue