From ddf7af7c3c6c995b4d8e98b00ef3af13dd0fd5f6 Mon Sep 17 00:00:00 2001 From: Alan Edmonds Date: Sun, 13 Jan 2019 07:59:41 +0000 Subject: [PATCH] issue #3: disable http compression to work around ruby Net::HTTP issues. --- lib/home_assistant/ble.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/home_assistant/ble.rb b/lib/home_assistant/ble.rb index bf8ed7e..ffb6d09 100644 --- a/lib/home_assistant/ble.rb +++ b/lib/home_assistant/ble.rb @@ -120,6 +120,7 @@ def update_home_assistant(ha_conf, state) uri = URI.join(home_assistant_url, '/api/services/device_tracker/see') 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 = ha_conf.to_json req_options = { use_ssl: uri.scheme == 'https' }