Giter Club home page Giter Club logo

Comments (4)

kb5zuy avatar kb5zuy commented on July 4, 2024 1

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.

mikalstill avatar mikalstill commented on July 4, 2024

I'm seeing this too. Happy to help debug if required.

from home_assistant-ble.

mikalstill avatar mikalstill commented on July 4, 2024

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.

mikalstill avatar mikalstill commented on July 4, 2024

Updating to the latest ruby with RVM didn't help.

from home_assistant-ble.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.