From ae15ee1cdb06b00803f4426b0e965510661c3322 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Sun, 27 Sep 2020 20:56:34 +0200 Subject: 2020-09-27 --- get-temps.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100755 get-temps.rb (limited to 'get-temps.rb') diff --git a/get-temps.rb b/get-temps.rb new file mode 100755 index 0000000..ac24051 --- /dev/null +++ b/get-temps.rb @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby + +while line = STDIN.gets + a = line.split + d = {} + a.each { |i| + name, val = i.split("::") + if name == "temperature" + d["temperature"] = val + end + if name == "device_id" + d["dev"] = val + end + } + puts d.to_s +end -- cgit v1.2.3