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
Are you willing to resolve this issue by submitting a Pull Request?
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
Cameraentity currently, so the best solution I could come up with was making three separate API Calls whenever a camera that hadfeature_flags.is_ptzwas 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
uiprotectdescribing 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
Are you willing to resolve this issue by submitting a Pull Request?