Skip to content

Conversation

@danez
Copy link

@danez danez commented May 14, 2025

I have this config:

shortcuts:
  - name: Level 1
    icon: 'mdi:fan-speed-1'
    percentage: 33
    preset_mode: Level
  - name: Level 2
    icon: 'mdi:fan-speed-2'
    percentage: 66
    preset_mode: Level
  - name: Level 3
    icon: 'mdi:fan-speed-3'
    percentage: 100
    preset_mode: Level

And no matter which shortcut I click, they are all always marked as active, because the preset_mode is always the same. In this simple example, I could of course remove the preset_mode, but I also have other shortcuts and different preset_modes.

This change improves the logic that determines whether the purifier is active by taking into account whether preset_mode and/or percentage are explicitly set in the configuration.

✅ Previous Behavior
The isActive state was determined by checking if either percentage or preset_mode matched their corresponding attribute values. This could lead to incorrect results when both options were configured.

🔄 Updated Behavior
Now, isActive is set to true only if:

  • (same as before) percentage matches and preset_mode is not set, or
  • (same as before) preset_mode matches and percentage is not set, or
  • Both preset_mode and percentage are set and match their respective attribute values.

@github-actions
Copy link

This PR is stale because there hasn't been any activity for a long time.

@github-actions github-actions bot added the stale label Aug 12, 2025
@danez
Copy link
Author

danez commented Aug 13, 2025

Not stale

@github-actions github-actions bot removed the stale label Aug 13, 2025
@github-actions
Copy link

This PR is stale because there hasn't been any activity for a long time.

@github-actions github-actions bot added the stale label Nov 11, 2025
@danez
Copy link
Author

danez commented Nov 11, 2025

No

@github-actions github-actions bot removed the stale label Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant