Skip to content

Commit

Permalink
Convert keys to a list
Browse files Browse the repository at this point in the history
  • Loading branch information
jontofront committed Dec 20, 2024
1 parent 0e0a5ab commit 15334f4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions custom_components/econet300/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ def create_sensors(
process_val=lambda x: x,
filter_condition: Callable[[str], bool] = lambda key: True,
) -> list:
"""Generic function to create sensors."""
"""Create sensors using the provided keys and conditions."""
entities = []
reg_data = coordinator.data.get("regParams", {})
sys_data = coordinator.data.get("sysParams", {})
Expand Down Expand Up @@ -153,7 +153,7 @@ def create_controller_sensors(
) -> list[EconetSensor]:
"""Create controller sensor entities."""
return create_sensors(
SENSOR_MAP_KEY["_default"],
list(SENSOR_MAP_KEY["_default"]),
coordinator,
api,
EconetSensor,
Expand Down Expand Up @@ -186,7 +186,7 @@ def mixer_filter(key: str) -> bool:
)

return create_sensors(
SENSOR_MIXER_KEY.keys(),
list(SENSOR_MIXER_KEY.keys()),
coordinator,
api,
MixerSensor,
Expand All @@ -208,7 +208,7 @@ def create_lambda_sensors(
return []

return create_sensors(
SENSOR_MAP_KEY["lambda"],
list(SENSOR_MAP_KEY["lambda"]),
coordinator,
api,
LambdaSensors,
Expand Down

0 comments on commit 15334f4

Please sign in to comment.