summaryrefslogtreecommitdiff
path: root/v1/get-temps.rb.bak
diff options
context:
space:
mode:
authorpks <pks@pks.rocks>2021-05-01 06:17:55 +0200
committerpks <pks@pks.rocks>2021-05-01 06:17:55 +0200
commitf461190e22a97bde985b067ce01c4ed9c74f7e62 (patch)
tree0c2c48d1933765f83d083241df2dd74c6603f2bc /v1/get-temps.rb.bak
parent63fbf0f3aadb4b6d037a8164b501fe836d9c361d (diff)
v1
Diffstat (limited to 'v1/get-temps.rb.bak')
-rwxr-xr-xv1/get-temps.rb.bak16
1 files changed, 16 insertions, 0 deletions
diff --git a/v1/get-temps.rb.bak b/v1/get-temps.rb.bak
new file mode 100755
index 0000000..ac24051
--- /dev/null
+++ b/v1/get-temps.rb.bak
@@ -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