Skip to content

Commit

Permalink
add configured name to sensor name
Browse files Browse the repository at this point in the history
  • Loading branch information
firstof9 committed Dec 23, 2024
1 parent f70e364 commit 9380872
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/nws_alerts/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from homeassistant.components.sensor import SensorDeviceClass, SensorEntityDescription
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import ATTR_ATTRIBUTION
from homeassistant.const import ATTR_ATTRIBUTION, CONF_NAME
from homeassistant.core import HomeAssistant, callback
from homeassistant.helpers.device_registry import DeviceEntryType
from homeassistant.helpers.entity import DeviceInfo
Expand Down Expand Up @@ -55,7 +55,7 @@ def __init__(
self._key = sensor_description.key

self._attr_icon = sensor_description.icon
self._attr_name = sensor_description.name
self._attr_name = f'{entry.data[CONF_NAME]} {sensor_description.name}'
self._attr_device_class = sensor_description.device_class

@property
Expand Down

0 comments on commit 9380872

Please sign in to comment.