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

Change default user agent to fix API calls #848

Merged
merged 1 commit into from
Jan 7, 2024

Conversation

gingerm0nkey
Copy link

Description:

Blink integration in HA becomes unavailable when requesting API through differents actions, like Arming, Disarming, Updating...

Entries in log journal are similar to the entry below, and the number of ocurrences depends on how often the API is requested.

ERROR (MainThread) [homeassistant.components.blink.coordinator] Error requesting blink data: 0, message='Attempt to decode JSON with unexpected mimetype: text/plain; charset=utf-8', url=URL('https://***')

Related issue (if applicable): fixes #

Checklist:

  • Local tests with tox run successfully PR cannot be meged unless tests pass
  • Changes tested locally to ensure platform still works as intended
  • Tests added to verify new code works

Copy link

codecov bot commented Jan 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (b5fe148) 99.86% compared to head (453ba62) 99.86%.

Additional details and impacted files
@@           Coverage Diff           @@
##              dev     #848   +/-   ##
=======================================
  Coverage   99.86%   99.86%           
=======================================
  Files           8        8           
  Lines        1470     1470           
=======================================
  Hits         1468     1468           
  Misses          2        2           
Flag Coverage Δ
unittests 99.86% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fronzbot fronzbot merged commit f0da567 into fronzbot:dev Jan 7, 2024
8 checks passed
@fronzbot
Copy link
Owner

fronzbot commented Jan 7, 2024

Sweet! I thought that might be it. Thanks for the PR 👍

@fronzbot fronzbot changed the title fix/ha integration status becomes unvailable when requesting api Change default user agent to fix API calls Jan 7, 2024
@mkmer
Copy link
Contributor

mkmer commented Jan 7, 2024

Yesterday, I had also changed the user agent to match the android app :
https://github.com/mkmer/blinkpy/blob/b79f8ca4833011658ad58eada38e54a189dd4af1/blinkpy/helpers/constants.py#L23

There were a few 406 errors at first, then the problems stopped. I'm no convinced this isn't a backend issue more than the change, but it doesn't break anything.

Should we go with what we are actually emulating in this field?

@Truepix
Copy link

Truepix commented Jan 7, 2024

Thanks to everyone who contributed to this fix. It's good to see a community working together. That's what makes us strong.

@daknightuk
Copy link

How do I now get the working update?

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.

5 participants