pkgs/starlink: fix convert.rb

This commit is contained in:
Astro 2021-05-23 23:28:09 +02:00
parent ef371b32c4
commit 14f377248b
1 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ require 'json'
HOSTNAME = IO::readlines("/proc/sys/kernel/hostname").join.strip
def out path, x
puts "PUTVAL \"#{HOSTNAME}/exec-starlink/current-#{path.join '.'}\" #{x}"
puts "PUTVAL \"#{HOSTNAME}/exec-starlink/current-#{path.join '.'}\" N:#{x}"
end
def recurse path, x
@ -22,7 +22,7 @@ def recurse path, x
elsif x.kind_of? Float
out path, x
elsif x.kind_of? Fixnum
elsif x.kind_of? Integer
out path, x.to_f
elsif x.kind_of? String and x =~ /^\-?\d*\.?\d+$/
out path, x.to_f