nielsfaber / scheduler-card

HA Lovelace card for control of scheduler entities
GNU General Public License v3.0
922 stars 117 forks source link

Bug with custom actions and schedule where the actions don't appear #778

Open lucas-dumartin opened 11 months ago

lucas-dumartin commented 11 months ago

Checklist

Card Version

v3.2.12

Component Version

v3.2.15

Bug description

After I added custom actions with the customize keyword in the yaml and using them the following is happening :

When I want to edit the Scheme : image

And I click on a time period with a custom action no other action value is proposed image

But if I add a new period with no custom action assigned I get the proposition for all the actions possible: image

Steps to reproduce

On a scheduler card add the following customize for lights :

customize:
  light:
    actions:
      - service: turn_on
        service_data:
          brightness: 50
        name: Conforting Light
        icon: mdi:lightbulb-on-40
      - service: turn_on
        service_data:
          brightness: 100
        name: Fully Lit Up
        icon: mdi:lightbulb-on

Then add an entry for a light and select "Make a scheme" : image

Add an action for each time period : image

Save then click on it to edit it again and you should not have any action proposition when you select a time period : image

You can make them re appear by adding and deleting a new time period

Additional info

No response

lucas-dumartin commented 11 months ago

Just found out that the UI can be fixed by changing the custom action with a % at the end of the values :

customize:
  light:
    actions:
      - service: turn_on
        service_data:
          brightness: 50%
        name: Conforting Light
        icon: mdi:lightbulb-on-40
      - service: turn_on
        service_data:
          brightness: 100%
        name: Fully Lit Up
        icon: mdi:lightbulb-on

But this just create a new issue as the string is now assigend to a int value in the brightness field

github-actions[bot] commented 10 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days

nielsfaber commented 10 months ago

I have never seen such issue, have no idea what causes this. There is nothing wrong with your configuration, adding the % behind is not a solution, it should no be used with the brightness parameter At the moment I’m working on a big layout change, possibly this will become fixed inherently. For the time being, you might want to use brightness_pct instead, this parameter accept a percentage which apparently works better.

lucas-dumartin commented 10 months ago

For the time being, you might want to use brightness_pct instead, this parameter accept a percentage which apparently works better.

I did just that and it fixed the issue Thanks for your good work !