Kodi Community Forum

Full Version: Trying to create an addon to adjust fan speed settings in config file
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm running Libreelec atm, and I'm trying to create an addon to be able to change the temp values and speed rate of a connected fan.

I can't seem to find a way to create an addon that displays config file that I can edit.
Or realistically find any information on creating an addon that executes and operates an .sh file

I think that this could somewhat work:
xbmc.executebuiltin('System.Exec(./deskpi-config)')
 but that just executes the file, it doesn't "run" it with the ability for me to interact with it on a GUI level.

This is the config file I'm trying to edit:
https://github.com/jojobrogess/deskpi/bl...kpi-config

It already has options for default speeds. As you can see here:
Line 61:
1)
log_action_msg "You've select 25% speed level"
sh -c "echo pwm_025 > $serial_port"
log_action_msg "Fan speed level has been change to 25%"
;;
2)
log_action_msg "You've select 50% speed level"
sh -c "echo pwm_050 > $serial_port"
log_action_msg "Fan speed level has been change to 50%"
;;

Maybe just supplying buttons that correspond to certain "pwm_000" controls and have those executed in bash, rather than editing the file altogether? but I don't think the settings would be persistent unless it was re-ran somehow to reset the from default values to user submitted.

I'm just lost on how I would call that function, display those results and submit the desired action within a kodi settings window and not a terminal.
And then beyond that I would like to be able to set custom default altogether.

Anyone have any information on how this would be possible?
or anything at all that could help with expanding my understanding of how this could be done