Skip to content

Conversation

@cebtenzzre
Copy link
Contributor

I'm not sure that ClientResponse can actually be matched like this.

It shouldn't be necessary here anyway - returning None implicitly if resp is not a ClientResponse doesn't seem like the right thing to do here.

@cebtenzzre
Copy link
Contributor Author

cc @jsl12

@jsl12
Copy link
Contributor

jsl12 commented Nov 23, 2025

This does "work" in the sense that you can use match/case to unpack objects like that, but I agree with you here.

I think I had that in there to force pyright to recognize the type or something, but it seems unnecessary now and your way is cleaner.

@cebtenzzre
Copy link
Contributor Author

You're right that this works, I just tested it. Still, the point of this match statement looks like to fall through if the ClientResponse doesn't match, which is confusing.

@acockburn acockburn merged commit 7241ac2 into AppDaemon:dev Nov 30, 2025
3 of 4 checks passed
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

Successfully merging this pull request may close these issues.

3 participants