#!/usr/bin/python3

import sys

from dtnsense import atsci, util

BOARDS = {
    "temp": atsci.TEMP,
    "cond": atsci.COND,
    "ph": atsci.PH,
}

board = BOARDS[sys.argv[1]]
cmd = sys.argv[2]

with util.GPIOGuard():
    sensor = atsci.AtSciSensor()
    sensor.switch(board)
    print(sensor.ask(cmd).decode("ascii"))
