Mercurial > code > home > repos > homeauto
view service/iot2/iot2_linux.nim @ 1492:7c7415cfbc02
iot2: WIP still. more messages schema
Ignore-this: ef94336852ff8885df861146fc1b01b
darcs-hash:f5e1ffe61ecff1a7430b58a7504e35dcc809b1f8
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Wed, 29 Jan 2020 01:03:40 -0800 |
parents | 455b1b80516e |
children |
line wrap: on
line source
import nimpy proc setup_python(): PyObject = let sys = pyImport("sys") discard sys.path.extend([ ".", # for devices.py itself "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()