Skip to content

Commit

Permalink
refactor: convert mixer sensor keys to strings for improved compatibi…
Browse files Browse the repository at this point in the history
…lity
  • Loading branch information
jontofront committed Dec 20, 2024
1 parent 2f16d96 commit 9ebc150
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions custom_components/econet300/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,11 +181,14 @@ def create_mixer_sensors(
def mixer_filter(key: str) -> bool:
return all(
coordinator.data.get("regParams", {}).get(k) is not None
for k in list(SENSOR_MIXER_KEY.get(key, []))
for k in SENSOR_MIXER_KEY.get(int(key), set())
)

# Convert integer keys to strings for create_sensors
keys_as_strings = [str(k) for k in SENSOR_MIXER_KEY]

return create_sensors(
list(SENSOR_MIXER_KEY.keys()),
keys_as_strings,
coordinator,
api,
MixerSensor,
Expand Down

0 comments on commit 9ebc150

Please sign in to comment.