mirror of
https://github.com/home-assistant/core.git
synced 2025-07-26 22:57:17 +00:00
Fix name truncation and unusual entity names for LaCrosse View (#78254)
This commit is contained in:
parent
2d7b364713
commit
677cba582b
@ -70,14 +70,14 @@ SENSOR_DESCRIPTIONS = {
|
|||||||
"HeatIndex": LaCrosseSensorEntityDescription(
|
"HeatIndex": LaCrosseSensorEntityDescription(
|
||||||
key="HeatIndex",
|
key="HeatIndex",
|
||||||
device_class=SensorDeviceClass.TEMPERATURE,
|
device_class=SensorDeviceClass.TEMPERATURE,
|
||||||
name="Heat Index",
|
name="Heat index",
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
value_fn=get_value,
|
value_fn=get_value,
|
||||||
native_unit_of_measurement=TEMP_FAHRENHEIT,
|
native_unit_of_measurement=TEMP_FAHRENHEIT,
|
||||||
),
|
),
|
||||||
"WindSpeed": LaCrosseSensorEntityDescription(
|
"WindSpeed": LaCrosseSensorEntityDescription(
|
||||||
key="WindSpeed",
|
key="WindSpeed",
|
||||||
name="Wind Speed",
|
name="Wind speed",
|
||||||
state_class=SensorStateClass.MEASUREMENT,
|
state_class=SensorStateClass.MEASUREMENT,
|
||||||
value_fn=get_value,
|
value_fn=get_value,
|
||||||
native_unit_of_measurement=SPEED_KILOMETERS_PER_HOUR,
|
native_unit_of_measurement=SPEED_KILOMETERS_PER_HOUR,
|
||||||
@ -136,6 +136,7 @@ class LaCrosseViewSensor(
|
|||||||
"""LaCrosse View sensor."""
|
"""LaCrosse View sensor."""
|
||||||
|
|
||||||
entity_description: LaCrosseSensorEntityDescription
|
entity_description: LaCrosseSensorEntityDescription
|
||||||
|
_attr_has_entity_name: bool = True
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
@ -148,10 +149,9 @@ class LaCrosseViewSensor(
|
|||||||
|
|
||||||
self.entity_description = description
|
self.entity_description = description
|
||||||
self._attr_unique_id = f"{sensor.sensor_id}-{description.key}"
|
self._attr_unique_id = f"{sensor.sensor_id}-{description.key}"
|
||||||
self._attr_name = f"{sensor.location.name} {description.name}"
|
|
||||||
self._attr_device_info = {
|
self._attr_device_info = {
|
||||||
"identifiers": {(DOMAIN, sensor.sensor_id)},
|
"identifiers": {(DOMAIN, sensor.sensor_id)},
|
||||||
"name": sensor.name.split(" ")[0],
|
"name": sensor.name,
|
||||||
"manufacturer": "LaCrosse Technology",
|
"manufacturer": "LaCrosse Technology",
|
||||||
"model": sensor.model,
|
"model": sensor.model,
|
||||||
"via_device": (DOMAIN, sensor.location.id),
|
"via_device": (DOMAIN, sensor.location.id),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user