dermotduffy / frigate-hass-card

A Lovelace card for Frigate in Home Assistant
MIT License
535 stars 59 forks source link

start_tap_action on iOS have the behavior of 2 tap in companion #1534

Open mguyard opened 1 week ago

mguyard commented 1 week ago

Checklist:

Release with the issue:

Last working release (if known):

First time i test it

Browser and Operating System:

With Safari and HA Companion on iOS 17.6.1 (iPhone 14 Pro)

Description of problem:

When i try a PTZ move with start_tap_action and end_tap_action, on my PC browser it's work as expected. But on my mobile it's exactly like i have click two time on the arrow and like it's do a start_tap_action / end_tap_action / start_tap_action / end_tap_action

Frigate card diagnostic information

{
  "ha_version": "2024.8.3",
  "card_version": "5.2.0",
  "browser": "Mozilla/5.0 (iPhone; CPU iPhone OS 17_6_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Home Assistant/2024.8.1 (io.robbie.HomeAssistant; build:2024.791; iOS 17.6.1) Mobile/HomeAssistant, like Safari",
  "date": "2024-09-15T13:41:58.828Z",
  "frigate_version": {
    "01J6PRRND78EXM2FGPWEPXZFTG": "5.4.0/0.14.1-f4f3cfa"
  },
  "lang": "en",
  "timezone": "Europe/Paris",
  "git": {
    "build_version": "5.2.0-HEAD+g69249b6",
    "build_date": "Fri, 23 Jun 2023 15:26:26 GMT",
    "commit_date": "Thu, 22 Jun 2023 09:21:26 -0600"
  },
  "config": {
    "type": "custom:frigate-card",
    "cameras": [
      {
        "live_provider": "image",
        "camera_entity": "camera.outdoor_portail",
        "id": "outdoor_portail_image",
        "dependencies": {
          "cameras": [
            "camera.outdoor_portail"
          ]
        }
      },
      {
        "camera_entity": "camera.outdoor_portail",
        "live_provider": "go2rtc",
        "engine": "frigate",
        "go2rtc": {
          "modes": [
            "webrtc"
          ]
        },
        "hide": true
      }
    ],
    "menu": {
      "buttons": {
        "substreams": {
          "icon": "mdi:play-box"
        }
      }
    },
    "elements": [
      {
        "type": "custom:frigate-card-ptz",
        "orientation": "vertical",
        "style": {
          "transform": "none",
          "right": "5%",
          "bottom": "10%"
        },
        "actions_left": {
          "start_tap_action": {
            "action": "call-service",
            "service": "frigate.ptz",
            "service_data": {
              "entity_id": "camera.outdoor_portail",
              "action": "move",
              "argument": "left"
            }
          },
          "end_tap_action": {
            "action": "call-service",
            "service": "frigate.ptz",
            "service_data": {
              "entity_id": "camera.outdoor_portail",
              "action": "stop"
            }
          }
        },
        "actions_right": {
          "start_tap_action": {
            "action": "call-service",
            "service": "frigate.ptz",
            "service_data": {
              "entity_id": "camera.outdoor_portail",
              "action": "move",
              "argument": "right"
            }
          },
          "end_tap_action": {
            "action": "call-service",
            "service": "frigate.ptz",
            "service_data": {
              "entity_id": "camera.outdoor_portail",
              "action": "stop"
            }
          }
        },
        "actions_up": {
          "start_tap_action": {
            "action": "call-service",
            "service": "frigate.ptz",
            "service_data": {
              "entity_id": "camera.outdoor_portail",
              "action": "move",
              "argument": "up"
            }
          },
          "end_tap_action": {
            "action": "call-service",
            "service": "frigate.ptz",
            "service_data": {
              "entity_id": "camera.outdoor_portail",
              "action": "stop"
            }
          }
        },
        "actions_down": {
          "start_tap_action": {
            "action": "call-service",
            "service": "frigate.ptz",
            "service_data": {
              "entity_id": "camera.outdoor_portail",
              "action": "move",
              "argument": "down"
            }
          },
          "end_tap_action": {
            "action": "call-service",
            "service": "frigate.ptz",
            "service_data": {
              "entity_id": "camera.outdoor_portail",
              "action": "stop"
            }
          }
        }
      }
    ]
  }
}

Javascript errors shown in the web inspector (if applicable):

Additional information:

dermotduffy commented 6 days ago

Please try the latest preview release: https://github.com/dermotduffy/frigate-hass-card/releases/tag/v6.0.0-beta.2

I'm not sure the issue will be fixed or not, but that code is substantially changed so it's difficult for me to even debug at this point. I also have no iOS device, so always tricky for me to find these things!

As you test, please remove ~everything under elements: as the new release will automatically detect and configure Frigate PTZ actions, so most of that config is not necessary anymore.