summaryrefslogtreecommitdiff
path: root/get-temps.rb
diff options
context:
space:
mode:
authorPatrick Simianer <p@simianer.de>2020-09-27 20:56:34 +0200
committerPatrick Simianer <p@simianer.de>2020-09-27 20:56:34 +0200
commitae15ee1cdb06b00803f4426b0e965510661c3322 (patch)
treed5f6eadaae86f588ab91b50db26624cdadaab8de /get-temps.rb
parent843bb50c48a8b11c572c1e64e0237d09d635e1f0 (diff)
2020-09-27
Diffstat (limited to 'get-temps.rb')
-rwxr-xr-xget-temps.rb16
1 files changed, 16 insertions, 0 deletions
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