cjkrolak / ThermostatSupervisor

supervisor to detect and correct thermostat deviations
MIT License
0 stars 0 forks source link

SHT31: add git pull and pip install to startup script #737

Closed cjkrolak closed 10 months ago

cjkrolak commented 10 months ago

startup script added in #600

enhance script to pull latest develop branch

current script:

  1. cd /home/pi/github/ThermostatSupervisor
  2. python -m thermostatsupervisor.sht31_flask_server

new script:

  1. cd /home/pi/github/ThermostatSupervisor
  2. git checkout develop
  3. git pull
  4. pip install -r requirements.txt
  5. python -m thermostatsupervisor.sht31_flask_server
cjkrolak commented 10 months ago

file: ~/.config/autostart/lxterm-autostart.desktop ref: https://forums.raspberrypi.com/viewtopic.php?t=66206

code before update:

[Desktop Entry]
Encoding=UTF-8
Name=SHT31 server autostart
Comment=Start a terminal and launch sht31 server
Exec=/usr/bin/lxterm -hold -e 'cd /home/pi/github/ThermostatSupervisor && python -m thermostatsupervisor.sht31_flask_server'
Terminal=true
X-KeepTerminal=true

code after update:

[Desktop Entry]
Encoding=UTF-8
Name=SHT31 server autostart
Comment=Start a terminal pull latest dev branch and launch sht31 server
Exec=/usr/bin/lxterm -hold -e 'cd /home/pi/github/ThermostatSupervisor && git checkout develop && git pull && pip install -r requirements.txt && python -m thermostatsupervisor.sht31_flask_server'
Terminal=true
X-KeepTerminal=true
cjkrolak commented 10 months ago

confirmed working OK on 12/10/23