Skip to content
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

HTTP status 412 (precondition failed) #16

Closed
ugumba opened this issue Nov 5, 2024 · 10 comments
Closed

HTTP status 412 (precondition failed) #16

ugumba opened this issue Nov 5, 2024 · 10 comments

Comments

@ugumba
Copy link

ugumba commented Nov 5, 2024

Hi, sorry to interrupt your flow... :-)

As of this morning, my Homey app for PCC receives 412 during authentication.
(It happens at least for another user and myself.)

I can reproduce with this code:

import { ComfortCloudClient } from 'panasonic-comfort-cloud-client'

let client = new ComfortCloudClient("1.22.0");
try {
    let token = await client.login("[email protected]", "yaddayaddayadda");
    console.log(token);
}
catch (e)
{
    console.log(e);
}

The Android app seems to work fine with the same credentials.
There was a notification about a change to the authentication flow (a simplification, I think) - this might not be related.

@xgcssch
Copy link

xgcssch commented Nov 5, 2024

Same here with NodeRed and node-red-contrib-panasonic-comfort-cloud.

@bisand
Copy link

bisand commented Nov 6, 2024

Same here with NodeRed and node-red-contrib-panasonic-comfort-cloud.

FYI: bisand/node-red-contrib-panasonic-comfort-cloud is by the way using this library.

@bisand
Copy link

bisand commented Nov 6, 2024

The login works fine and a token is returned, but when it tries to call getClientId() it fails with "Request failed with status code 412 Precondition Failed"

private async getClientId(token: string): Promise<string> {

@pacholoamit
Copy link

Similar to this issue sockless-coding/panasonic_cc#331

@marc2016
Copy link
Owner

marc2016 commented Nov 7, 2024

If there is a solution, I will implement it as quickly as possible :-)
I am keeping track of the discussion on that issue.

@marc2016
Copy link
Owner

marc2016 commented Nov 8, 2024

This is the solution I think: sockless-coding/panasonic_cc#336
I will try to implement and test it in my project.

@hrrrsn
Copy link

hrrrsn commented Nov 8, 2024

If it helps you, my original implementation was in Javascript before porting to Python.

@marc2016
Copy link
Owner

marc2016 commented Nov 8, 2024

@hrrrsn thank you, that helped very much! :-)
Issue is fixed in version 2.0.3

@marc2016 marc2016 closed this as completed Nov 8, 2024
@ugumba
Copy link
Author

ugumba commented Nov 9, 2024

Fantastic - thank you both for the quick fix!
Verified locally with my app, and pushed a new version.

@nordlings
Copy link

Thanks 😀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants