Skip to content

Commit

Permalink
add self.entity_description to logger
Browse files Browse the repository at this point in the history
  • Loading branch information
jontofront authored Dec 20, 2023
1 parent 848f111 commit 5364964
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions custom_components/econet300/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def __init__(self, entity_description, unique_id):
"EconetSensor initialized with name: %s, unique_id: %s",
self.name,
self.unique_id,
self.entity_description,
)

@property
Expand Down Expand Up @@ -96,7 +97,7 @@ def create_entity_description(key: str):
map_key = REG_PARAM_MAP.get(key, key)
_LOGGER.debug("REG_PARAM_MAP: %s", REG_PARAM_MAP)
_LOGGER.debug("Creating entity description for key: %s, map_key: %s", key, map_key)
return EconetSensorEntityDescription(
entity_description = EconetSensorEntityDescription(
key=key,
translation_key=camel_to_snake(map_key),
native_unit_of_measurement=REG_PARAM_UNIT.get(map_key, None),
Expand All @@ -106,7 +107,8 @@ def create_entity_description(key: str):
process_val=REG_PARAM_VALUE_PROCESSOR.get(map_key, lambda x: x),
entity_category=REG_PARAM_ENTITY_CATEGORY.get(map_key, None),
)

_LOGGER.debug("Created entity description: %s", entity_description)
return entity_description

def create_controller_sensors(coordinator: EconetDataCoordinator, api: Econet300Api):
"""Creating controller sensor entities"""
Expand Down

0 comments on commit 5364964

Please sign in to comment.