[Feature Request] Automaticcaly valid change in privacy notice
Hi,
I wanted to share some knowledge and ask for help evaluationg this feature request.
I use this library with home assistant to control my heatpumps, works like a charm. But I starting noticing some issues from time to time where the library stops working because Panasonic wants me to validate change in the privacy notice. So all my automations stop working and I have to open the app, validate the changes, and restart HA. It is not a big deal, but it is still annoying.
Since I am bad with python, if someone wants to implements this, here is my findings.
I've decompiled the app and it seems that this endpoint:
-
If you have to validate a change, it will throw an error 401 with this message :
{"message":"Please login again and confirm the privacy notice","code":4102}This message is thrown not a login (login will be successfull but when you do other requests, like get the devices, or the status or I think anything apart from logging in -
[GET] https://accsmart.panasonic.com/auth/agreement/status/ is in charge of of handling this.
it will return something like
{ "agreementStatus": 0 } If no validation is required and
{ "agreementStatus": 1 } if it expects a validation
- A put request with a json body as
{ "agreementStatus": 1 or 0 , "type":2 }I really don't remeber the value I've put for agreementStatus in postman to make it work, I solid think it is 0. And type 2 seems to indicate the type of aggremment that we want to validate, in this case Privacy notice (1 and 0 is for the EULA).
Basically with this I managed to validate it with postman, but I really don't know how to implement this. So I was hoping that if someone finds it as annoying as I do, and have the skills and the will to implement it, those information can help.
Thank you
I really like the idea, and I think it should be possible to accept the new agreement through the CLI, but I also think the safest way to do so, is to have a command to accept the agreement whenever this happens. - this way this module will not hit any violations regarding Panasonic.
I totally agree that this should be raised properly and not automatically accepted by default internally.
Maybe exposing methods to check if a pending privacy notice validation exist and another method to accept it should do the trick for the cli and all the other apps relying on your module.
I'll add that, it appears that I received validation request of the exact same privacy notice, as if Panasonic API "forgot" that I already gone through the validation process. So it may be also a feature that covers a bug from Panasonic API
Le ven. 5 juin 2020 à 08:31, lostfields [email protected] a écrit :
I really like the idea, and I think it should be possible to accept the new agreement through the CLI, but I also think the safest way to do so, is to have a command to accept the agreement whenever this happens. - this way this module will not hit any violations regarding Panasonic.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/lostfields/python-panasonic-comfort-cloud/issues/25#issuecomment-639286813, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACSPIHDBUCFZUL2E57ZEZO3RVCGNJANCNFSM4NS2IGTQ .