Closed Azelphur closed 3 years ago
Thanks for contribution!
If I add additional configuration param for example admin_only_services
and by default it's will be true it's will be more useful?
Sure, that would solve it for me.
Edit: I spotted this it talks about a new permissions system and calls on integration developers to read up on how to check permissions I'll look into it when I have some time and see if there's anything relevant to this PR in there.
@azelphur thanks for information! I check Home Assistant Core code and add user permission checks in the same way how they did it. I was check it according article which you points me, and it's works! ;-) Please update to the lattest version and let's me know if it's works for you. Thanks in advance.
Doesn't work for me, tried running:
service: dahua_vto.open_door
data:
entity_id: sensor.doorbell
channel: 1
short_number: HA
and nothing happens. Nothing in the logs either. Done a little debugging, it seems DahuaVTO.async_open_door never gets called.
Very strange, check it again, works. sensor.doorbell
in OK state and has deviceType
and serialNumber
attributes?
Do you change user group permissions or you did test under user with admin rights?
sensor.doorbell has state "OK" and attributes:
Tested with both admin and normal user, in both cases nothing happens. If I revert your most recent commit and restart home assistant, it works (only as an admin user)
Very strange, which version of Home Assistant do you have? I test it with 2021.9, just updates integration using HACS and all works as with previous version.
Can you try to revert to 1.0.4 using HACS (or uninstall) and update to 1.0.5 using HACS?
I'm using 2021.9.2, for reference I run home assistant (core only), using docker, and I have added this component manually (no HACS).
If it helps, I'm on the official home assistant discord, we could chat there and try and debug it.
This is resolved in the most recent release, thanks again :)
With the use of async_register_admin_service, only administrator accounts can use these features. I bumped into this issue where non-admin users were unable to trigger door unlock.
This patch resolves that issue, but may not be the best way of doing it. If the use of async_register_admin_service was intentional, perhaps some way to allow non admin users access would be handy.