Add missing YoctoLib.cmdline package installation.

This commit is contained in:
yohan 2024-06-09 08:59:13 +02:00
parent 3ef6afa2b8
commit 916adf97f2
2 changed files with 3 additions and 1 deletions

View File

@ -6,6 +6,8 @@ RUN apt-get update && apt-get -y install gunicorn sqlite3 python3-pip python3-re
ENV PIP_BREAK_SYSTEM_PACKAGES 1
RUN pip install teleinfo
WORKDIR /root
RUN curl -o YoctoLib.cmdline.24497.tar.gz "https://cloud.scimetis.net/s/y7WengZWJpYnGpr/download"
RUN tar xzvf YoctoLib.cmdline.24497.tar.gz
COPY find_ttyUSB.sh /root/
COPY read_one-wire_sensor.py /root/
COPY read_teleinfo.py /root/

View File

@ -16,7 +16,7 @@ parser.add_argument('sensor', type=str,
args = parser.parse_args()
try:
returned_output = subprocess.check_output(["/usr/local/YoctoLib.cmdline.24497/Binaries/linux/32bits/"+args.binary, "-r", "localhost", "-f", "[result]", args.sensor, "get_currentValue"])
returned_output = subprocess.check_output(["/root/YoctoLib.cmdline.24497/Binaries/linux/32bits/"+args.binary, "-r", "localhost", "-f", "[result]", args.sensor, "get_currentValue"])
try:
value = round(float(returned_output.decode("utf-8").strip().strip("'")), 1)
except ValueError: