vacuum-card icon indicating copy to clipboard operation
vacuum-card copied to clipboard

Migrate from service to action

Open grolnn opened this issue 5 months ago • 1 comments

The use of services is deprecated since the 2024.8 release and should be updated to using actions.

For example, this is now the correct code to call an action and works when I manually trigger it from Developer > Actions. However, it does not work with this custom card. Here I need to use the deprecated service and service_data.

Should work, new best practice. But does not work with this custom card yet:

              shortcuts:
                - name: Living room
                  icon: 'mdi:sofa'
                  action: vacuum.send_command #--- note the use of action, not service
                  data: #--- note the use of data, not service_data
                    command: app_segment_clean
                    params:
                      - segments: 
                          - 16
                        repeat: 1
                  target:
                    entity_id: vacuum.marvin

Deprecated, but works with this custom card:

             shortcuts:
                - name: Living room
                  icon: 'mdi:sofa'
                  service: vacuum.send_command
                  service_data:
                    command: app_segment_clean
                    params:
                      - segments: 
                          - 16
                        repeat: 1
                  target:
                    entity_id: vacuum.marvin

grolnn avatar Sep 20 '24 13:09 grolnn