Skip to content

Conversation

@averybiteydinosaur
Copy link
Contributor

Convert text response to JSON to allow for incorrect mime type returned by hardware.

@ahayworth
Copy link
Owner

Hi there @averybiteydinosaur - thanks for reporting this, and finding a quick fix! I think overall this looks okay, but would you mind adding a test for this as well?

(The CI jobs are failing for unrelated reasons, and I will fix them shortly).

@averybiteydinosaur
Copy link
Contributor Author

Hi @ahayworth - sure thing I'll make sure to add tests and submit properly, must admit I wasn't certain how active the repo was initially when I opened this.

I've an enhancement to add power-status that I'm going to have a look at as well, so I'll add testing and do a proper commit for this fix, and then move onto that afterwards, though probably won't be until mid/end next week as I'm away from my desk for a while.

@ahayworth
Copy link
Owner

Thanks!

must admit I wasn't certain how active the repo was initially when I opened this.

I would say it's in maintenance-mode - it meets my needs and works well enough for the ~1400 people who use it in home assistant, and the company behind Awair doesn't seem to be releasing new consumer hardware any more.

That said, I'm happy to accept little patches like this - it's not a huge burden for me or anything. I appreciate the effort!

@averybiteydinosaur
Copy link
Contributor Author

Updated the branch to include tests for text/html responses based on pre-existing tests, but altered the headers to simulate the response coming from a backplate device instead.

Much appreciated for maintaining this :)

@averybiteydinosaur
Copy link
Contributor Author

I've added test data properly now rather than cribbing and editing the original ones, also swapped formatter to black and fixed the mess of the gitlog I made originally.

Hope that hasn't caused too much hassle.

@ahayworth
Copy link
Owner

No worries @averybiteydinosaur - it's not a hassle at all. Apologies on my end that this has dragged on a bit as well, I've been incredibly distracted as of late.

It looks like the formatter is still failing - if you're able to fix that as well, that would be great. If not, I will try to get to it tonight once I'm back on my own machine. 😄

Convert text response to JSON to allow for incorrect mime type returned by hardware.
Add test coverage for text/html version of responses
@averybiteydinosaur
Copy link
Contributor Author

Third time's the charm, triple checked linting and should be good 🤞

Copy link
Owner

@ahayworth ahayworth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic, it looks great - thank you so much for the work, and for the back-and-forth about linting. And most especially for your patience, since I have been rather distracted as of late.

@ahayworth ahayworth merged commit 683cb06 into ahayworth:master Oct 9, 2025
5 checks passed
@averybiteydinosaur
Copy link
Contributor Author

All good, you'll note a distinct lack of progress from me on the power-status enhancement I mentioned working on :P
(though hope to sort that soon)

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.

2 participants