Slide 30
Slide 30 text
Harvestのデータ
一度電圧が落ちたものの , 正常に
復旧
mechatrax, sleepi3ctl, https://github.com/mechatrax/sleepi3-utils
sleepi3ctlを使用して電圧を取得
↓
Harvestに送信
from subprocess import run, PIPE
import requests
def get_voltage
() -> tuple[str, str]:
cmd1 = ['sudo', 'sleepi3ctl'
, 'get', 'voltage', '1']
cmd2 = ['sudo', 'sleepi3ctl'
, 'get', 'voltage', '2']
cp_result1 = run(cmd1, stdout=PIPE, check=True, encoding='utf-8')
cp_result2 = run(cmd2, stdout=PIPE, check=True, encoding='utf-8')
return (cp_result1.stdout, cp_result2.stdout)