Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Allow plugins ability to augment the html displays?
#11
OK, I got your example plugin working. Looks good!
It took a bit of doing to clone your SIP updates:
Code:
git clone https://github.com/jonathan-marsh/SIP.git

and then manually install the plugin files.

By the way, there was a recent pull request that added some changes to the sip_service.sh script in the SIP folder. It sets up a Python virtual environment  and modifies the sip.service to run sip.py using the Python interpreter from the venv. This allows plugins to install dependencies without errors.

I added some code to your diurnal_display.py plugin file:

Code:
try:
    from suncalc import get_times
except ModuleNotFoundError:
    command = "pip install suncalc"
    subprocess.call(command.split())
    from suncalc import get_times


This also requires adding "import subprocess" to the standard library imports.
With this code your plugin installs the required suncalc module on the first run without any user action.

To get this to work you will need to disable any existing system_d sip service:
Code:
systemctl disable sip
and then run the script from the SIP folder:
Code:
bash sip_service.sh
then reboot.
<p><br></p>
Reply


Messages In This Thread
RE: Allow plugins ability to augment the html displays? - by dan - 2024 Aug 05, 04:30 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)