Skip to content

Commit

Permalink
fix default login key and set a default value
Browse files Browse the repository at this point in the history
  • Loading branch information
romkey committed Nov 16, 2021
1 parent 4087b9c commit fdb2c62
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion homebus.gemspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Gem::Specification.new do |s|
s.name = 'homebus'
s.version = '0.10.13'
s.version = '0.10.14'
s.licenses = ['MIT']
s.summary = 'Ruby interface to HomeBus'
s.description = 'Ruby interface to the HomeBus MQTT automatic provisioner'
Expand Down
6 changes: 5 additions & 1 deletion lib/homebus/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def initialize
@login_config_filename = File.join(ENV['HOME'], DEFAULT_LOGIN_CONFIG_FILENAME)
@local_config_filename = DEFAULT_LOCAL_CONFIG_FILENAME

@login_config = { default: nil, next_index: 0, homebus_instances: [] }
@login_config = { default_login: nil, next_index: 0, homebus_instances: [] }
@local_config = {}
end

Expand Down Expand Up @@ -58,6 +58,10 @@ def load_local
end

def save_login
if !@login_config[:default_login] && @login_config[:homebus_instances].length > 0
@login_config[:default_login] = 0
end

File.open(@login_config_filename, 'w') do |f|
f.puts JSON.pretty_generate(@login_config)
end
Expand Down

0 comments on commit fdb2c62

Please sign in to comment.