Skip to content

Commit

Permalink
Update sensor.py
Browse files Browse the repository at this point in the history
If set "friendly name", it is displayed correctly .
  • Loading branch information
mcasper73 committed Dec 28, 2019
1 parent a82843d commit d033f19
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions custom_components/attributes/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ def async_setup_platform(hass, config, async_add_devices, discovery_info=None):
if device_state is not None:
device_friendly_name = device_state.attributes.get('friendly_name')
else:
device_friendly_name = None

if device_friendly_name is None:
device_friendly_name = device.split(".", 1)[1]

friendly_name = config.get(ATTR_FRIENDLY_NAME, device_friendly_name)
Expand Down Expand Up @@ -222,9 +219,6 @@ def async_update(self):
if entity_state is not None:
device_friendly_name = entity_state.attributes.get('friendly_name')
else:
device_friendly_name = None

if device_friendly_name is not None:
self._name = device_friendly_name

try:
Expand Down

0 comments on commit d033f19

Please sign in to comment.