Skip to content

Better support for PTZ State / PTZ Presets #436

Description

@nlowe

Is your feature request related to a problem? Please describe.

Recently, I attempted to add support for exposing PTZ State and Preset metadata in Home Assistant. However, it seems that this data isn't exposed in the Camera entity currently, so the best solution I could come up with was making three separate API Calls whenever a camera that had feature_flags.is_ptz was updated, which required doing horrible things with asyncio because the websocket handler isn't async.

Let's discuss the best way to make these enhancements possible..

Describe alternatives you've considered

@bdraco suggested grabbing this data from the websocket connection instead. This would be great, but it seems Unifi just doesn't send this data, we only get sent the zoom level in the ISP info. We do get info when PTZ Presets are created / updated / deleted it seems. Given there are already objects in uiprotect describing these, it should be simple to wire those up to the websocket, but because it's not included in the initial bootstrap information I'm not certain how best to structure this. See this discussion on the PR for details:

home-assistant/core#142129 (comment)

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Are you willing to resolve this issue by submitting a Pull Request?

  • Yes, I have the time, and I know how to start.
  • Yes, I have the time, but I don't know how to start. I would need guidance.
  • No, I don't have the time, although I believe I could do it if I had the time...
  • No, I don't have the time and I wouldn't even know how to start.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions