ruby_home 0.2.5 → 0.2.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/tests.yml +4 -4
  3. data/.gitignore +2 -2
  4. data/.rubocop.yml +2 -9
  5. data/.standard.yml +3 -0
  6. data/CHANGELOG.md +6 -1
  7. data/Gemfile +2 -2
  8. data/Rakefile +4 -4
  9. data/examples/air_purifier.rb +7 -8
  10. data/examples/air_quality_sensor.rb +8 -9
  11. data/examples/battery_service.rb +2 -3
  12. data/examples/carbon_dioxide_sensor.rb +2 -3
  13. data/examples/carbon_monoxide_sensor.rb +3 -4
  14. data/examples/contact_sensor.rb +2 -3
  15. data/examples/door.rb +5 -6
  16. data/examples/fan.rb +2 -3
  17. data/examples/fan_v2.rb +2 -3
  18. data/examples/garage_door_opener.rb +9 -10
  19. data/examples/heater_cooler.rb +9 -10
  20. data/examples/humidifier_dehumidifier.rb +9 -10
  21. data/examples/humidity_sensor.rb +2 -3
  22. data/examples/leak_sensor.rb +2 -3
  23. data/examples/light_sensor.rb +2 -3
  24. data/examples/lightbulb.rb +2 -3
  25. data/examples/lock_mechanism.rb +6 -7
  26. data/examples/motion_sensor.rb +2 -3
  27. data/examples/occupancy_sensor.rb +2 -3
  28. data/examples/outlet.rb +2 -3
  29. data/examples/security_system.rb +12 -13
  30. data/examples/smoke_sensor.rb +2 -3
  31. data/examples/switch.rb +2 -3
  32. data/examples/television.rb +8 -13
  33. data/examples/temperature_sensor.rb +2 -3
  34. data/examples/thermostat.rb +10 -11
  35. data/examples/window.rb +5 -6
  36. data/examples/window_covering.rb +5 -6
  37. data/lib/ruby_home.rb +21 -21
  38. data/lib/ruby_home/accessory.rb +1 -1
  39. data/lib/ruby_home/accessory_collection.rb +6 -6
  40. data/lib/ruby_home/accessory_info.rb +18 -18
  41. data/lib/ruby_home/characteristic.rb +8 -8
  42. data/lib/ruby_home/characteristic_collection.rb +13 -13
  43. data/lib/ruby_home/config/characteristics.yml +30 -635
  44. data/lib/ruby_home/config/manual_characteristics.yml +278 -0
  45. data/lib/ruby_home/config/manual_services.yml +45 -0
  46. data/lib/ruby_home/config/services.yml +329 -370
  47. data/lib/ruby_home/configuration.rb +4 -4
  48. data/lib/ruby_home/device_id.rb +3 -3
  49. data/lib/ruby_home/dns/service.rb +4 -6
  50. data/lib/ruby_home/dns/text_record.rb +9 -9
  51. data/lib/ruby_home/errors.rb +1 -0
  52. data/lib/ruby_home/factories/characteristic_factory.rb +37 -37
  53. data/lib/ruby_home/factories/service_factory.rb +72 -72
  54. data/lib/ruby_home/factories/templates/characteristic_template.rb +5 -5
  55. data/lib/ruby_home/factories/templates/service_template.rb +11 -10
  56. data/lib/ruby_home/hap/crypto/chacha20poly1305.rb +2 -2
  57. data/lib/ruby_home/hap/crypto/hkdf.rb +4 -4
  58. data/lib/ruby_home/hap/crypto/session_key.rb +7 -7
  59. data/lib/ruby_home/hap/decrypter.rb +8 -8
  60. data/lib/ruby_home/hap/encrypter.rb +5 -6
  61. data/lib/ruby_home/hap/ev_response.rb +17 -17
  62. data/lib/ruby_home/hap/hap_request.rb +1 -1
  63. data/lib/ruby_home/hap/server.rb +4 -4
  64. data/lib/ruby_home/hap/server_handler.rb +8 -10
  65. data/lib/ruby_home/hap/session.rb +22 -22
  66. data/lib/ruby_home/hap/values/base_value.rb +3 -3
  67. data/lib/ruby_home/hap/values/bool_value.rb +4 -4
  68. data/lib/ruby_home/hap/values/float_value.rb +4 -4
  69. data/lib/ruby_home/hap/values/identify_value.rb +1 -1
  70. data/lib/ruby_home/hap/values/int32_value.rb +4 -4
  71. data/lib/ruby_home/hap/values/null_value.rb +1 -1
  72. data/lib/ruby_home/hap/values/string_value.rb +11 -11
  73. data/lib/ruby_home/hap/values/uint32_value.rb +5 -5
  74. data/lib/ruby_home/hap/values/uint8_value.rb +14 -14
  75. data/lib/ruby_home/hex_helper.rb +3 -3
  76. data/lib/ruby_home/http/application.rb +7 -7
  77. data/lib/ruby_home/http/controllers/accessories_controller.rb +3 -3
  78. data/lib/ruby_home/http/controllers/application_controller.rb +6 -6
  79. data/lib/ruby_home/http/controllers/characteristics_controller.rb +29 -29
  80. data/lib/ruby_home/http/controllers/identify_controller.rb +10 -10
  81. data/lib/ruby_home/http/controllers/pair_setups_controller.rb +18 -18
  82. data/lib/ruby_home/http/controllers/pair_verifies_controller.rb +9 -9
  83. data/lib/ruby_home/http/controllers/pairings_controller.rb +5 -5
  84. data/lib/ruby_home/http/serializers/accessory_serializer.rb +5 -5
  85. data/lib/ruby_home/http/serializers/characteristic_serializer.rb +24 -24
  86. data/lib/ruby_home/http/serializers/characteristic_value_serializer.rb +5 -5
  87. data/lib/ruby_home/http/serializers/object_serializer.rb +1 -1
  88. data/lib/ruby_home/http/serializers/service_serializer.rb +9 -9
  89. data/lib/ruby_home/http/serializers/uuid_helper.rb +2 -2
  90. data/lib/ruby_home/http/services/session_notifier.rb +8 -8
  91. data/lib/ruby_home/http/services/start_srp_service.rb +3 -3
  92. data/lib/ruby_home/http/services/verify_finish_service.rb +22 -22
  93. data/lib/ruby_home/http/services/verify_srp_service.rb +22 -22
  94. data/lib/ruby_home/identifier_cache.rb +4 -5
  95. data/lib/ruby_home/password.rb +14 -14
  96. data/lib/ruby_home/persistable.rb +22 -7
  97. data/lib/ruby_home/service.rb +3 -3
  98. data/lib/ruby_home/service_collection.rb +1 -1
  99. data/lib/ruby_home/version.rb +1 -1
  100. data/rubyhome.gemspec +31 -31
  101. data/sbin/characteristic_generator.rb +22 -24
  102. data/sbin/service_generator.rb +36 -27
  103. metadata +25 -8
@@ -1,10 +1,10 @@
1
- require_relative 'base_value'
1
+ require_relative "base_value"
2
2
 
3
3
  module RubyHome
4
4
  class Uint32Value < BaseValue
5
5
  DEFAULT_VALUES = {
6
6
  color_temperature: 50,
7
- lock_management_auto_security_timeout: 0,
7
+ lock_management_auto_security_timeout: 0
8
8
  }.freeze
9
9
 
10
10
  def default
@@ -13,8 +13,8 @@ module RubyHome
13
13
 
14
14
  private
15
15
 
16
- def name
17
- template.name
18
- end
16
+ def name
17
+ template.name
18
+ end
19
19
  end
20
20
  end
@@ -1,4 +1,4 @@
1
- require_relative 'base_value'
1
+ require_relative "base_value"
2
2
 
3
3
  module RubyHome
4
4
  class Uint8Value < BaseValue
@@ -8,22 +8,22 @@ module RubyHome
8
8
 
9
9
  private
10
10
 
11
- def first_default_value
12
- valid_values.keys.first
13
- end
11
+ def first_default_value
12
+ valid_values.keys.first
13
+ end
14
14
 
15
- def valid_values
16
- defined_values || range_values || raise(UnknownValueError, "Constraint contains an unrecognized list of values: #{template.constraints.inspect }")
17
- end
15
+ def valid_values
16
+ defined_values || range_values || raise(UnknownValueError, "Constraint contains an unrecognized list of values: #{template.constraints.inspect}")
17
+ end
18
18
 
19
- def defined_values
20
- template.constraints.dig('ValidValues')
21
- end
19
+ def defined_values
20
+ template.constraints.dig("ValidValues")
21
+ end
22
22
 
23
- def range_values
24
- if min = template.constraints.dig('MinimumValue')
25
- { min.to_s => min }
26
- end
23
+ def range_values
24
+ if (min = template.constraints.dig("MinimumValue"))
25
+ {min.to_s => min}
27
26
  end
27
+ end
28
28
  end
29
29
  end
@@ -1,15 +1,15 @@
1
1
  module RubyHome
2
2
  module HexHelper
3
3
  def self.pad(input, pad_length: 24)
4
- pack_hex_string(unpack_hex_string(input).rjust(pad_length, '0'))
4
+ pack_hex_string(unpack_hex_string(input).rjust(pad_length, "0"))
5
5
  end
6
6
 
7
7
  def self.unpack_hex_string(input)
8
- input.to_s.unpack1('H*')
8
+ input.to_s.unpack1("H*")
9
9
  end
10
10
 
11
11
  def self.pack_hex_string(input)
12
- [input].pack('H*')
12
+ [input].pack("H*")
13
13
  end
14
14
  end
15
15
  end
@@ -1,16 +1,16 @@
1
- Dir[File.dirname(__FILE__) + '/controllers/*.rb'].each { |file| require file }
1
+ Dir[File.dirname(__FILE__) + "/controllers/*.rb"].each { |file| require file }
2
2
 
3
3
  module RubyHome
4
4
  module HTTP
5
5
  class Application
6
6
  def self.rack_builder
7
7
  ::Rack::Builder.new do
8
- map('/accessories') { run AccessoriesController }
9
- map('/characteristics') { run CharacteristicsController }
10
- map('/identify') { run IdentifyController }
11
- map('/pair-setup') { run PairSetupsController }
12
- map('/pair-verify') { run PairVerifiesController }
13
- map('/pairings') { run PairingsController }
8
+ map("/accessories") { run AccessoriesController }
9
+ map("/characteristics") { run CharacteristicsController }
10
+ map("/identify") { run IdentifyController }
11
+ map("/pair-setup") { run PairSetupsController }
12
+ map("/pair-verify") { run PairVerifiesController }
13
+ map("/pairings") { run PairingsController }
14
14
  end
15
15
  end
16
16
  end
@@ -1,10 +1,10 @@
1
- require_relative 'application_controller'
1
+ require_relative "application_controller"
2
2
 
3
3
  module RubyHome
4
4
  module HTTP
5
5
  class AccessoriesController < ApplicationController
6
- get '/' do
7
- content_type 'application/hap+json'
6
+ get "/" do
7
+ content_type "application/hap+json"
8
8
 
9
9
  if session.sufficient_privileges?
10
10
  AccessorySerializer.new(identifier_cache.accessories).serialized_json
@@ -1,21 +1,21 @@
1
- require 'logger'
1
+ require "logger"
2
2
 
3
3
  module RubyHome
4
4
  module HTTP
5
5
  class ApplicationController < Sinatra::Base
6
6
  disable :protection
7
7
 
8
- logger = Logger.new(STDOUT)
9
- logger.level = case ENV['DEBUG']
10
- when 'debug'
8
+ logger = Logger.new($stdout)
9
+ logger.level = case ENV["DEBUG"]
10
+ when "debug"
11
11
  Logger::DEBUG
12
- when 'info'
12
+ when "info"
13
13
  Logger::INFO
14
14
  else
15
15
  Logger::WARN
16
16
  end
17
17
  set :logger, logger
18
- enable :logging if ENV['DEBUG']
18
+ enable :logging if ENV["DEBUG"]
19
19
 
20
20
  before do
21
21
  logger.debug "Session"
@@ -1,19 +1,19 @@
1
- require_relative 'application_controller'
1
+ require_relative "application_controller"
2
2
 
3
3
  module RubyHome
4
4
  module HTTP
5
5
  class CharacteristicsController < ApplicationController
6
6
  before do
7
- content_type 'application/hap+json'
7
+ content_type "application/hap+json"
8
8
  require_session
9
9
  end
10
10
 
11
- get '/' do
11
+ get "/" do
12
12
  CharacteristicValueSerializer.new(find_characteristics).serialized_json
13
13
  end
14
14
 
15
- put '/' do
16
- json_body.fetch('characteristics', []).each do |characteristic_params|
15
+ put "/" do
16
+ json_body.fetch("characteristics", []).each do |characteristic_params|
17
17
  if characteristic_params.key?("value")
18
18
  update_characteristics(characteristic_params)
19
19
  elsif characteristic_params.key?("ev")
@@ -26,40 +26,40 @@ module RubyHome
26
26
 
27
27
  private
28
28
 
29
- def find_characteristics
30
- params.fetch(:id, "").split(',').flat_map do |characteristic_params|
31
- aid, iid = characteristic_params.split('.')
32
- find_characteristic(aid: aid, iid: iid)
33
- end
29
+ def find_characteristics
30
+ params.fetch(:id, "").split(",").flat_map do |characteristic_params|
31
+ aid, iid = characteristic_params.split(".")
32
+ find_characteristic(aid: aid, iid: iid)
34
33
  end
34
+ end
35
35
 
36
- def update_characteristics(characteristic_params)
37
- find_characteristic(**characteristic_params.symbolize_keys.slice(:aid, :iid)) do |characteristic|
38
- characteristic.value = characteristic_params['value']
39
- end
36
+ def update_characteristics(characteristic_params)
37
+ find_characteristic(**characteristic_params.symbolize_keys.slice(:aid, :iid)) do |characteristic|
38
+ characteristic.value = characteristic_params["value"]
40
39
  end
40
+ end
41
41
 
42
- def subscribe_characteristics(characteristic_params)
43
- find_characteristic(**characteristic_params.symbolize_keys.slice(:aid, :iid)) do |characteristic|
44
- notifier = SessionNotifier.new(session, characteristic)
42
+ def subscribe_characteristics(characteristic_params)
43
+ find_characteristic(**characteristic_params.symbolize_keys.slice(:aid, :iid)) do |characteristic|
44
+ notifier = SessionNotifier.new(session, characteristic)
45
45
 
46
- unless characteristic.listeners.include?(notifier)
47
- characteristic.subscribe(notifier)
48
- end
46
+ unless characteristic.listeners.include?(notifier)
47
+ characteristic.subscribe(notifier)
49
48
  end
50
49
  end
50
+ end
51
51
 
52
- def find_characteristic(aid:, iid:)
53
- characteristic = identifier_cache.find_characteristic(accessory_id: aid.to_i, instance_id: iid.to_i)
54
- yield characteristic if block_given?
55
- characteristic
56
- end
52
+ def find_characteristic(aid:, iid:)
53
+ characteristic = identifier_cache.find_characteristic(accessory_id: aid.to_i, instance_id: iid.to_i)
54
+ yield characteristic if block_given?
55
+ characteristic
56
+ end
57
57
 
58
- def require_session
59
- unless session.sufficient_privileges?
60
- halt 401, JSON.generate({"status" => -70401})
61
- end
58
+ def require_session
59
+ unless session.sufficient_privileges?
60
+ halt 401, JSON.generate({"status" => -70401})
62
61
  end
62
+ end
63
63
  end
64
64
  end
65
65
  end
@@ -1,9 +1,9 @@
1
- require_relative 'application_controller'
1
+ require_relative "application_controller"
2
2
 
3
3
  module RubyHome
4
4
  module HTTP
5
5
  class IdentifyController < ApplicationController
6
- post '/' do
6
+ post "/" do
7
7
  if accessory_info.paired?
8
8
  paired_accessory
9
9
  else
@@ -13,15 +13,15 @@ module RubyHome
13
13
 
14
14
  private
15
15
 
16
- def paired_accessory
17
- status 400
18
- content_type 'application/hap+json'
19
- JSON.generate({"status" => -70401})
20
- end
16
+ def paired_accessory
17
+ status 400
18
+ content_type "application/hap+json"
19
+ JSON.generate({"status" => -70401})
20
+ end
21
21
 
22
- def unpaired_accessory
23
- halt 204
24
- end
22
+ def unpaired_accessory
23
+ halt 204
24
+ end
25
25
  end
26
26
  end
27
27
  end
@@ -1,10 +1,10 @@
1
- require_relative 'application_controller'
1
+ require_relative "application_controller"
2
2
 
3
3
  module RubyHome
4
4
  module HTTP
5
5
  class PairSetupsController < ApplicationController
6
- post '/' do
7
- content_type 'application/pairing+tlv8'
6
+ post "/" do
7
+ content_type "application/pairing+tlv8"
8
8
 
9
9
  case unpack_request[:state]
10
10
  when 1
@@ -37,7 +37,7 @@ module RubyHome
37
37
  verify_srp = VerifySRPService.new(
38
38
  device_proof: unpack_request[:proof],
39
39
  srp_session: session.srp_session,
40
- public_key: unpack_request[:public_key],
40
+ public_key: unpack_request[:public_key]
41
41
  ).run
42
42
 
43
43
  if verify_srp.success?
@@ -53,12 +53,12 @@ module RubyHome
53
53
  def exchange
54
54
  encrypted_data = unpack_request[:encrypted_data]
55
55
 
56
- hkdf = HAP::Crypto::HKDF.new(info: 'Pair-Setup-Encrypt-Info', salt: 'Pair-Setup-Encrypt-Salt')
56
+ hkdf = HAP::Crypto::HKDF.new(info: "Pair-Setup-Encrypt-Info", salt: "Pair-Setup-Encrypt-Salt")
57
57
  key = hkdf.encrypt(session.session_key)
58
58
 
59
59
  chacha20poly1305ietf = HAP::Crypto::ChaCha20Poly1305.new(key)
60
60
 
61
- nonce = HexHelper.pad('PS-Msg05')
61
+ nonce = HexHelper.pad("PS-Msg05")
62
62
  decrypted_data = chacha20poly1305ietf.decrypt(nonce, encrypted_data)
63
63
  unpacked_decrypted_data = TLV.decode(decrypted_data)
64
64
 
@@ -66,36 +66,36 @@ module RubyHome
66
66
  iosdevicesignature = unpacked_decrypted_data[:signature]
67
67
  iosdeviceltpk = unpacked_decrypted_data[:public_key]
68
68
 
69
- hkdf = HAP::Crypto::HKDF.new(info: 'Pair-Setup-Controller-Sign-Info', salt: 'Pair-Setup-Controller-Sign-Salt')
69
+ hkdf = HAP::Crypto::HKDF.new(info: "Pair-Setup-Controller-Sign-Info", salt: "Pair-Setup-Controller-Sign-Salt")
70
70
  iosdevicex = hkdf.encrypt(session.session_key)
71
71
 
72
72
  iosdeviceinfo = [
73
- iosdevicex.unpack1('H*'),
74
- iosdevicepairingid.unpack1('H*'),
75
- iosdeviceltpk.unpack1('H*')
73
+ iosdevicex.unpack1("H*"),
74
+ iosdevicepairingid.unpack1("H*"),
75
+ iosdeviceltpk.unpack1("H*")
76
76
  ].join
77
77
  verify_key = RbNaCl::Signatures::Ed25519::VerifyKey.new(iosdeviceltpk)
78
78
 
79
- if verify_key.verify(iosdevicesignature, [iosdeviceinfo].pack('H*'))
80
- hkdf = HAP::Crypto::HKDF.new(info: 'Pair-Setup-Accessory-Sign-Info', salt: 'Pair-Setup-Accessory-Sign-Salt')
79
+ if verify_key.verify(iosdevicesignature, [iosdeviceinfo].pack("H*"))
80
+ hkdf = HAP::Crypto::HKDF.new(info: "Pair-Setup-Accessory-Sign-Info", salt: "Pair-Setup-Accessory-Sign-Salt")
81
81
  accessory_x = hkdf.encrypt(session.session_key)
82
82
 
83
83
  signing_key = accessory_info.signing_key
84
84
  accessoryltpk = signing_key.verify_key.to_bytes
85
85
  accessoryinfo = [
86
- accessory_x.unpack1('H*'),
87
- accessory_info.device_id.unpack1('H*'),
88
- accessoryltpk.unpack1('H*')
86
+ accessory_x.unpack1("H*"),
87
+ accessory_info.device_id.unpack1("H*"),
88
+ accessoryltpk.unpack1("H*")
89
89
  ].join
90
90
 
91
- accessorysignature = signing_key.sign([accessoryinfo].pack('H*'))
91
+ accessorysignature = signing_key.sign([accessoryinfo].pack("H*"))
92
92
 
93
93
  subtlv = tlv(identifier: accessory_info.device_id, public_key: accessoryltpk, signature: accessorysignature)
94
94
 
95
- nonce = HexHelper.pad('PS-Msg06')
95
+ nonce = HexHelper.pad("PS-Msg06")
96
96
  encrypted_data = chacha20poly1305ietf.encrypt(nonce, subtlv)
97
97
 
98
- pairing_params = { admin: true, identifier: iosdevicepairingid, public_key: iosdeviceltpk.unpack1('H*') }
98
+ pairing_params = {admin: true, identifier: iosdevicepairingid, public_key: iosdeviceltpk.unpack1("H*")}
99
99
  accessory_info.add_paired_client(**pairing_params)
100
100
 
101
101
  tlv state: 6, encrypted_data: encrypted_data
@@ -1,10 +1,10 @@
1
- require_relative 'application_controller'
1
+ require_relative "application_controller"
2
2
 
3
3
  module RubyHome
4
4
  module HTTP
5
5
  class PairVerifiesController < ApplicationController
6
- post '/' do
7
- content_type 'application/pairing+tlv8'
6
+ post "/" do
7
+ content_type "application/pairing+tlv8"
8
8
 
9
9
  verify_accessory_paired
10
10
 
@@ -26,22 +26,22 @@ module RubyHome
26
26
  session.shared_secret = shared_secret
27
27
 
28
28
  accessoryinfo = [
29
- public_key.unpack1('H*'),
30
- accessory_info.device_id.unpack1('H*'),
31
- client_public_key.to_bytes.unpack1('H*')
29
+ public_key.unpack1("H*"),
30
+ accessory_info.device_id.unpack1("H*"),
31
+ client_public_key.to_bytes.unpack1("H*")
32
32
  ].join
33
33
 
34
34
  signing_key = accessory_info.signing_key
35
- accessorysignature = signing_key.sign([accessoryinfo].pack('H*'))
35
+ accessorysignature = signing_key.sign([accessoryinfo].pack("H*"))
36
36
 
37
37
  subtlv = tlv(identifier: accessory_info.device_id, signature: accessorysignature)
38
38
 
39
- hkdf = HAP::Crypto::HKDF.new(info: 'Pair-Verify-Encrypt-Info', salt: 'Pair-Verify-Encrypt-Salt')
39
+ hkdf = HAP::Crypto::HKDF.new(info: "Pair-Verify-Encrypt-Info", salt: "Pair-Verify-Encrypt-Salt")
40
40
  session_key = hkdf.encrypt(shared_secret)
41
41
  session.session_key = session_key
42
42
 
43
43
  chacha20poly1305ietf = HAP::Crypto::ChaCha20Poly1305.new(session_key)
44
- nonce = HexHelper.pad('PV-Msg02')
44
+ nonce = HexHelper.pad("PV-Msg02")
45
45
  encrypted_data = chacha20poly1305ietf.encrypt(nonce, subtlv)
46
46
 
47
47
  tlv state: 2, public_key: public_key, encrypted_data: encrypted_data
@@ -1,10 +1,10 @@
1
- require_relative 'application_controller'
1
+ require_relative "application_controller"
2
2
 
3
3
  module RubyHome
4
4
  module HTTP
5
5
  class PairingsController < ApplicationController
6
- post '/' do
7
- content_type 'application/pairing+tlv8'
6
+ post "/" do
7
+ content_type "application/pairing+tlv8"
8
8
 
9
9
  case unpack_request[:method]
10
10
  when 3
@@ -20,7 +20,7 @@ module RubyHome
20
20
  pairing_params = {
21
21
  admin: !!unpack_request[:permissions],
22
22
  identifier: unpack_request[:identifier],
23
- public_key: unpack_request[:public_key].unpack1('H*')
23
+ public_key: unpack_request[:public_key].unpack1("H*")
24
24
  }
25
25
  accessory_info.add_paired_client(**pairing_params)
26
26
 
@@ -30,7 +30,7 @@ module RubyHome
30
30
  def remove_pairing
31
31
  accessory_info.remove_paired_client(unpack_request[:identifier])
32
32
 
33
- response['connection'] = 'close'
33
+ response["connection"] = "close"
34
34
  tlv state: 2
35
35
  end
36
36
  end
@@ -1,5 +1,5 @@
1
- require_relative 'object_serializer'
2
- require_relative 'service_serializer'
1
+ require_relative "object_serializer"
2
+ require_relative "service_serializer"
3
3
 
4
4
  module RubyHome
5
5
  module HTTP
@@ -7,13 +7,13 @@ module RubyHome
7
7
  include ObjectSerializer
8
8
 
9
9
  def root
10
- 'accessories'
10
+ "accessories"
11
11
  end
12
12
 
13
13
  def record_hash(accessory)
14
14
  {
15
- 'aid' => accessory.id,
16
- 'services' => ServiceSerializer.new(accessory.services).serializable_hash,
15
+ "aid" => accessory.id,
16
+ "services" => ServiceSerializer.new(accessory.services).serializable_hash
17
17
  }
18
18
  end
19
19
  end