Ring Integration-Trying to add start recording service to integration

I am trying to add an implementation of the start record method in the Ring Python library into the Ring HA integration and I am having trouble retrieving the Ring camera by entity_id passed in from the service call. Here is my code so far from my fork:

https://github.com/JoeDaddy7105/home-assistant/blob/09aee55d1934234dc06adc7027312c11007e5321/homeassistant/components/ring/init.py#L144-L148

Here is the method call from the Ring Python library I am trying to trigger:

I am just looking to trigger recording on a camera. My plan is to add an Automation that triggers recording on a specific camera when a door sensor triggers. I also want to add another service to trigger a snapshot update and then grab the latest snapshot from a specific camera and then add that to the above automation to attach the snapshot to a notification or email when the same door sensor is triggered. Here is the snapshot feature from the Ring Python library which I was planning to implement in a similar way as a service if I can get the Ring camera object by entity_id:

How do I get the Ring camera by entity_id? Is this the right approach to add these as services in init.py?

1 Like

My main issue is this line to get the camera entity from the entity_id provided by the service call:

camera = hass.data[DOMAIN][entity_id]

What is the proper syntax to get the camera entities from the hass.data with a given entity_id?