Skip to content

Commit

Permalink
Update entities.py
Browse files Browse the repository at this point in the history
  • Loading branch information
OStrama authored Oct 28, 2024
1 parent f3cfb46 commit c337394
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions custom_components/weishaupt_modbus/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,16 +242,15 @@ def __init__(self, config_entry, modbus_item, modbus_api) -> None:

dev_postfix = ""
try:
dev_postfix = "_" + self._config_entry.data[CONF_DEVICE_POSTFIX]
dev_postfix = self._config_entry.data[CONF_DEVICE_POSTFIX]
dev_postfix = "_" + dev_postfix
except KeyError:
dev_postfix = ""
warnings.warn("Device postfix not defined, use default: ")

dev_prefix = CONST.DEF_PREFIX
try:
dev_prefix = "_" + self._config_entry.data[CONF_PREFIX]
dev_prefix = self._config_entry.data[CONF_PREFIX]
except KeyError:
dev_prefix = ""
warnings.warn("Device prefix not defined, use default: " + CONST.DEF_PREFIX)

self._attr_unique_id = (
Expand Down

0 comments on commit c337394

Please sign in to comment.