fl4p / batmon-ha

Add-on for Home Assistant to connect JK, JBD, Daly, ANT, SOK and Supervolt BMS via Bluetooth
MIT License
246 stars 53 forks source link

Pip install into venv #177

Closed webbbn closed 6 months ago

webbbn commented 6 months ago

I believe the Home Assistant addon base image was changed to prevent pip installs into the system area. This patch creates a venv to use for pip installing python packages and changes the addon_main.sh script to run within that venv.

fl4p commented 6 months ago

Thanks, I'd like to have this line

RUN python3 -m venv venv && \
    . ./venv/bin/activate && \
    python -m pip install -r requirements.txt

split into three run commands. can you change this?

Home Assistant has poor error logging when it builds add-opn images, and only prints the line that fails