Mercurial > code > home > repos > homeauto
diff service/iot2/iot2_linux.nim @ 1490:455b1b80516e
introduce capnp, more build, some demos
Ignore-this: 29801e9e9f8a85fd0d822207c6eacce1
darcs-hash:b2da18876d27b0fb9192811375752b5c4e7322e0
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Thu, 23 Jan 2020 21:00:47 -0800 |
parents | a4fb4cc60ae1 |
children |
line wrap: on
line diff
--- a/service/iot2/iot2_linux.nim Tue Jan 21 23:59:45 2020 -0800 +++ b/service/iot2/iot2_linux.nim Thu Jan 23 21:00:47 2020 -0800 @@ -4,13 +4,23 @@ let sys = pyImport("sys") discard sys.path.extend([ ".", # for devices.py itself - "env/lib/python3.7/site-packages" # for deeper imports + "build/py/lib/python3.7/site-packages" # for deeper imports ]) pyImport("devices") +import json +import osproc +proc getSomeTemp(): float = + let sensorsJson = execProcess("sensors", args=["-j"], options={poUsePath}) + let res = parseJson(sensorsJson) + res["coretemp-isa-0000"]["Core 0"]["temp2_input"].getFloat + + + + echo "iot2_linux starting" - +echo getSomeTemp() let devices = setup_python() discard devices.hello()