-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
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
Reolink privacy mode #135947
Reolink privacy mode #135947
Conversation
It would be nicer to rewrite that as
|
Thanks for the suggestion, just changed it in the upstream lib: starkillerOG/reolink_aio@9d398a5 |
Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If privacy mode is turned ON when starting, the integration will disable privacy mode for about 5-10 seconds to get the needed information to be able to start the integration (mainly the capabalities of the camera). Then the Privacy mode will be enabled again.
I'm against enabling it even for a short period as the user enabled it for a certain reason. The integration could store the needed information to setup in a storage file, so have a cache for already know devices.
If a user adds a new camera with the privacy mode enabled, the integration should offer in my opinion only a restart and privacy mode entity
I also think that we should not do this. As in, Reolink now seem like the good choice for local devices. I think if the devices now provide a privacy mode, and with Home Assistant we break that mode, its not really that privacy after all. I think it the beauty and challenge here is to make sure that we can do without that information. This way the device and the mode does what it promises. I think for adding a new device I think its a sensible question to ask if the user wants to disable privacy mode, so we can set up the camera correctly. |
Well this is going to be a challange. Do you have an example of how to storage a large amount of text in a data file? Probably the most visable approach would be to cache the complete reponse to all get_host_data commands, and load that in when Privacy mode is enabled. That info will not be retrieved again, which could lead to some very curious user issues: |
Isn't it possible just to compile a list of "this camera supports x, x, x"? Because the entities being set up are either unknown or unavailable, so we should not store enough to know all info, but we should know enough to know which entities to set up. |
But then how do I get all the other info I need during statup: The checking of the RTSP URL will in fact be another thing I will need to take into account, I should also store that URL, did not think of that yet. |
For the time being I think it would be okay to say, let's just retry if its in privacy mode |
I would only store data, which is really required for setting up the entities.
In my opinion, you don't need to know this kind of information as the camera entity will unavailable and therefore you don't need the difference between the RTSP urls |
Do not disable privacy mode during login
@joostlek @edenhaus my appologies for beeing a bit grumpy about the needed changes. There are still some things to do:
However could you take a look at the way I am now saving and loading the required data to a file? I know you would prefer to save the minimum amount of needed info, but I think it will be a lot more robust towards the future if I save the whole host data json. This way the upstream libary follows the same process as if the camera just responded with data. So I don't need to make exceptions everywhere in case data is not know yet. In the future I would need to remember to add those exception each time I add some new stuff... |
This PR has grown too big, therefore I am splitting it up:
|
Breaking change
Proposed change
Reolink recently added a "Privacy mode" to the firmware of the Reolink E1 Zoom.
When the user activates this mode, the camera streams, HTTP API, ONVIF, RTMP, RTSP ports are all shut down.
Basically the only two things the camera can do at this point is disabling the privacy mode or rebooting (only options left in the Reolink app also).
This integration uses those protocols so this causes a whole bunch of errors and problems.
This version bump of the upstream library paired with some changes to the Home Assistant code resolves this issue: The integration will always be able to setup.
During runtime, privacy mode will not cause any errors anymore, all entities of this integration will be marked as unavailable.
As soon as privacy mode is turned off all entities will become available again (push update, so almost instant).
I have a follow up PR ready that will add a switch entity that can enable/disable this privacy mode. This entity will stay available even if privacy mode is turned ON. The user will be able to turn off privacy mode through this entity to get all entities available again.
Type of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: