From ddf7af7c3c6c995b4d8e98b00ef3af13dd0fd5f6 Mon Sep 17 00:00:00 2001 From: Alan Edmonds Date: Sun, 13 Jan 2019 07:59:41 +0000 Subject: [PATCH 1/2] 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' } From de0f0843fefa9a78af67bce83361942cc4d3bf7e Mon Sep 17 00:00:00 2001 From: Alan Edmonds Date: Thu, 14 Mar 2019 17:16:05 +0000 Subject: [PATCH 2/2] Allow larger methods. --- .rubocop.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.rubocop.yml b/.rubocop.yml index 1b1b0ca..241bdb0 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -2,7 +2,7 @@ Metrics/LineLength: Max: 140 Metrics/MethodLength: - Max: 25 + Max: 35 Metrics/ClassLength: Max: 200