Python script to change xbmc system settings

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
giftie Online
Skilled Python Coder
Posts: 2,036
Joined: Mar 2010
Reputation: 35
Post: #11
I always thought that the HTTP API class(through xbmc.executehttpapi() ) was always available to addons even when the webserver is turned off(since addons are 'internal') I know this is how xbmc.executeJSONRPC() works.

[Image: e4f63e45ba34fe4695b3bb08eb2499d8e4ee484e...4c076g.jpg]
For troubleshooting and bug reporting please make sure you read this first you can also use XBMC Log Uploader Script.
Cinema Experience
Cinema Experience Wiki
cdART Manager
fanart.tv


find quote
Jason102 Offline
Fan
Posts: 555
Joined: Nov 2010
Reputation: 28
Location: Fuquay-Varina, NC
Post: #12
Quite right, executehttpapi does work without the web server enabled. I just tested this and was able to change the web server to on...but only the setting itself...the web server still wasn't accessible until I restarted XBMC. It's odd because before a restart I can go to the system settings and see the tick mark for the server being on, but I still can't access the page itself. Looking at the code this makes sense...it sets the setting but doesn't do anything with it. Any clever tricks I can play to actually turn this on?

[Image: PseudoTV_icon.jpg]
Channel surfing for your video library
Development Blog Repository
(This post was last modified: 2011-06-16 16:26 by Jason102.)
find quote
walinsky Offline
Junior Member
Posts: 25
Joined: Feb 2006
Reputation: 0
Post: #13
Jason102 Wrote:So changing settings can be done through the HTTP API...but is there any way to forcefully enable the webserver from a script if it's off? The only ways I can see are both ridiculous: manually modifying guisettings.xml to enable it and then using executebuiltin to restart XBMC (which wouldn't restart the running script), or using the builtin functions to open the settings window with setfocus and sendclick to the proper control to turn it on. Neither are good options.

Exactly my thoughts... HTTP API being a bad choice anyway as it's obsolete in favor of JSON API.
HTTP API will 'set' changes as requested;
Quote:setGUISetting(0;videoscreen.resolution;14)
returns OK, and querying after having that
Quote:getGUISetting(0;videoscreen.resolution)
will even report the new set value.
However it doesn't seem to change anything system-wise...
find quote
topfs2 Offline
Team-XBMC Developer
Posts: 3,825
Joined: Dec 2007
Reputation: 8
Post: #14
walinsky Wrote:Exactly my thoughts... HTTP API being a bad choice anyway as it's obsolete in favor of JSON API.
HTTP API will 'set' changes as requested;
returns OK, and querying after having that will even report the new set value.
However it doesn't seem to change anything system-wise...

The API works on per profile basis, this is true for all interfaces (JSON-RPC included). It has been suggested, and something we think about, introducing a way for a client to authenticate as any profile in JSON-RPC.

Setting wrapping in JSON-RPC is wanted but it waits for a) secret store and password managager, so we can control access to secrets. b) settings remodel so its easier to introspect settings (for now it would have to be hardcoded, which isn't nice and not manageable).

If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
find quote
kiboy6 Offline
Fan
Posts: 607
Joined: Mar 2009
Reputation: 0
Post: #15
ronie Wrote:currently yes.
someone came up with a patch to change that behavior:
https://github.com/xbmc/xbmc/pull/177

So did this patch ever make it into a pre-compiled version of XBMC that can be Downloaded?

If not is there any chance of someone compiling a pre-Eden version with the patch included?

Would be a simple solution to the "switch screens from remote control" problem that has several threads on it here...

Thanks a lot if anyone has any ideas about this!
find quote
kiboy6 Offline
Fan
Posts: 607
Joined: Mar 2009
Reputation: 0
Post: #16
just a small bump....especially now i have my shiny new Nyxboard Remote I would so love to be able to switch screens without either: a) Having to close XBMC and then re-open it, or b) turning on the screen I don;t want tjust to access the system menu and switch over to the screen I do want.

Thanks!
find quote
kiboy6 Offline
Fan
Posts: 607
Joined: Mar 2009
Reputation: 0
Post: #17
And another bump....

The inability to seamlessly switch between monitors is the only rough edge to my HTPC setup...would so love to find a way to resolve it.

Thanks!
find quote
kiboy6 Offline
Fan
Posts: 607
Joined: Mar 2009
Reputation: 0
Post: #18
Bump again....is still nobody able to one-press switch display screens while playing music? Especially with the increasing popularity of projectors I'm surprised there is still AFAIK no way of doing this....

This profile switch patch would have done the trick, but it seems it never made it into XBMC?
find quote
walinsky Offline
Junior Member
Posts: 25
Joined: Feb 2006
Reputation: 0
Post: #19
And another bump.
Anyone found a way to one-press switching displays already?
find quote
kiboy6 Offline
Fan
Posts: 607
Joined: Mar 2009
Reputation: 0
Post: #20
It is now possible with the help of Eventghost or another automation program. Some time ago a XBMC update included the improved behaviour where XBMC would auto-change it's resolution when moved between different sized screens.

So now all one has to do is extend your display over both screens and map a remote button to an EventGhost task that moves the XBMC instance from one screen to another. XBMC will auto adjust to the required new resolution Smile
find quote
Post Reply