Cannot set StelCore.currentTimeZone via RemoteControl API #3914
-
Greetings! I am trying to set the StelCore.currentTimeZone property from a Python script using the RemoteControl plugin API. I would expect the following code, using stelproperty/set, to do the trick but it does not work ... import requests
# specify URL to Stellarium RemoteControl API
url_stellarium = 'http://localhost:8090/api/'
# set time zone ... this DOESN'T work
params_tz = {'id':'StelCore.currentTimeZone', 'value':'LTST'}
response = requests.post(url_stellarium + 'stelproperty/set') Does anyone know what I am doing wrong? The response.status_code is 200, indicating that it worked, but the time zone does not change. I have figured out a workaround using scripts/direct ... import requests
# specify URL to Stellarium RemoteControl API
url_stellarium = 'http://localhost:8090/api/'
# set time zone ... this DOES work
params_direct = {'code': 'core.setTimezone(\"LTST\")'}
response = requests.post(url_stellarium + 'scripts/direct', data = params_direct) While I am happy that I have a working method, I feel like I am not understanding how to use stelproperty/set correctly. Any insight as to how to do this the "right" way would be sincerely appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Where do you pass |
Beta Was this translation helpful? Give feedback.
Where do you pass
params_tz
? In your code it's only defined but not passed.