Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for mouse down/up/long-click to ptz UI #520

Merged
merged 6 commits into from
Jul 11, 2023

Conversation

dbuezas
Copy link
Contributor

@dbuezas dbuezas commented Jul 9, 2023

Camera apps typically treat ptz controls slightly different than this card: movement starts on mouse down and ends on mouse up
This PR allows for callbacks for each event independently, enabling this behaviour.
It also adds support for long press, which is useful to set the home preset.

Usage example:

type: custom:webrtc-camera
url: camarablanca_dvrip
shortcuts:
  services:
    - name: Sync
      icon: mdi:clock-check
      service: icsee_ptz.synchronize_clock
      service_data:
        camera: garden
ptz:
  service: icsee_ptz.move
  data_home:
    camera: garden
    cmd: GotoPreset
    preset: 0
  data_long_home:
    camera: garden
    cmd: SetPreset
    preset: 0
  data_start_left:
    camera: garden
    cmd: DirectionLeft
    move_time: 10
  data_end_left:
    camera: garden
    cmd: DirectionLeft
    move_time: 0
  data_start_right:
    camera: garden
    cmd: DirectionRight
    move_time: 10
  data_end_right:
    camera: garden
    cmd: DirectionRight
    move_time: 0
  data_start_up:
    camera: garden
    cmd: DirectionUp
    move_time: 10
  data_end_up:
    camera: garden
    cmd: DirectionUp
    move_time: 0
  data_start_down:
    camera: garden
    cmd: DirectionDown
    move_time: 10
  data_end_down:
    camera: garden
    cmd: DirectionDown
    move_time: 0

Something similar can also be achieved with the onvif service using move_mode: ContinuousMove

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.

2 participants