Skip to content

Commit

Permalink
Friendly name fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pilotak committed May 31, 2020
2 parents bc2e181 + d033f19 commit d58f021
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 d58f021

Please sign in to comment.