Comments (4)
I'm running this on a RaspberryPI 3B with ruby 2.3.0. I had the same or similar issue; crash when receiving the response from homeassistant. BTW, I'm running HA 0.85.1 on a RaspberryPI 3B. I suspected an issue with deflating the response from HA, so I forced the accept-encoding header to 'identity' to disable compressed responses. That fixed the issue and it's now working. I do not believe that home_assistant_ble will every be transferring huge amounts of data, so this is probably an acceptable change - until ruby is fixed. Patch below or would you like a PR for this one-liner?
def update_home_assistant(ha_conf, state)
ha_name = ha_conf['name']
uri = URI.join(home_assistant_url, "api/states/device_tracker.#{ha_name}")
request = Net::HTTP::Post.new(uri)
request.content_type = 'application/json'
+ request['Accept-Encoding'] = 'identity'
request['X-Ha-Access'] = home_assistant_password if home_assistant_password
request.body = state_update(ha_conf, state)
req_options = { use_ssl: uri.scheme == 'https' }
from home_assistant-ble.
I'm seeing this too. Happy to help debug if required.
from home_assistant-ble.
This seems to be a ruby issue where ruby for some reasons is trying to inflate something which wasn't compressed in the first place. I see bug reports against older versions of ruby for this.
from home_assistant-ble.
Updating to the latest ruby with RVM didn't help.
from home_assistant-ble.
Related Issues (7)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from home_assistant-ble.