AmoebeLabs / swiss-army-knife-card

The versatile custom Swiss Army Knife card for Home Assistant allows you to create your unique visualization using several graphical tools, styling options and animations.
223 stars 19 forks source link

Can't use notify service because of entity_id being added #250

Open Khaos66 opened 2 months ago

Khaos66 commented 2 months ago

Bug report notice

Before you file a bug, make sure that you did not make a configuration mistake. The Swiss Army Knife in its current state does not yet have full configuration sanity checks!

So make sure your problem is not related to that!

Swiss Army Knife version

The version you are using. See HACS or the Browser console 2.5.1

Bug description

call-service action will always add entity_id to service_data which is not allowed when notify.* services are called.

Failed to call service notify/mobile_app_oneplus_open. extra keys not allowed @ data['entity_id']

To Reproduce

Steps to reproduce the behavior:

  1. You need a notify service, so connect the Android companion app. This adds notify.mobile_app_* as a service.
  2. Add a tool with the user_actions below
  3. Click on the tool in a dashboard
user_actions:
  tap_action:
    haptic: success
    actions:
      - action: call-service
        service: "notify.mobile_app_*"
        service_data:
          message: message
          data:
            title: "Test"

Expected behavior

Instead of a message on the Android phone an HA error message is shown in the dashboard

Screenshots

None

Desktop browser (please complete the following information):

Companion App on Smartphone/Tablet (please complete the following information):

Additional context https://github.com/AmoebeLabs/swiss-army-knife-card/blob/b19d4d8d353aba86f88ab2efd05e7f11bf7d0b64/src/base-tool.js#L586

(Optional): Suggested Solution

I need a switch to deaktivate the addition of missing entity_id. Maybe likte this

user_actions:
  tap_action:
    haptic: success
    actions:
      - action: call-service
        service: "notify.mobile_app_*"
        no_entity_id: true
        service_data:
          message: message
          data:
            title: "Test"
github-actions[bot] commented 2 months ago

Thank you for creating your first issue for the Swiss Army Knife custom card!

Khaos66 commented 2 months ago

@AmoebeLabs Please tell me your prefered solution. I can create a PR. Also let me know where I'll have to adjust the docs