Skip to content

Commit

Permalink
[Beta fix] Fixed an issue with the sensor entity name
Browse files Browse the repository at this point in the history
  • Loading branch information
nao-pon committed Mar 14, 2024
1 parent 2f99181 commit 74b1acd
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions custom_components/echonetlite/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,7 @@ def __init__(self, connector, op_code, attributes, name=None, hass=None) -> None
self._attr_state_class = self._sensor_attributes.get(CONF_STATE_CLASS)

# Create name based on sensor description from EPC codes, super class codes or fallback to using the sensor type
self._attr_name = get_name_by_epc_code(
self._eojgc, self._eojcc, self._op_code, self._attr_device_class
)
self._attr_name = f"{name} {get_name_by_epc_code(self._eojgc, self._eojcc, self._op_code, self._attr_device_class)}"

if "dict_key" in _attr_keys:
self._attr_unique_id += f'-{self._sensor_attributes["dict_key"]}'
Expand Down

0 comments on commit 74b1acd

Please sign in to comment.