Hi all,
At the moment I'm a bit lost in what api's are available from Python. I know there is a (limited) description of json calls but want to know what I can call directly from Python.
For now I want to access the settings without having to call /json.htm?type=settings.
Please let me know if/where to find this information.
Thanks,
--Gerard
How to access settings Topic is solved
Moderator: leecollings
-
- Posts: 81
- Joined: Sunday 04 January 2015 0:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest-1
- Location: /dev/null
- Contact:
Re: How to access settings and more
Sorry to bump this question. Additionally to my previous post I also want to create and access user variables from the python plugin. Is that possible and if so, how?
Thanks,
--Gerard
Thanks,
--Gerard
- Dnpwwo
- Posts: 819
- Joined: Sunday 23 March 2014 9:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Melbourne, Australia
- Contact:
Re: How to access settings
@gerardvs,
When "Add Settings collection #1289" pull request gets merged you will be able to Domoticz settings via a Setting dictionary from within a plugin.
What are you trying to achieve by accessing User Variables? These are designed for users to access during events from Lua and I can't think why you would access them from a plugin that interfaces to an external device.
When "Add Settings collection #1289" pull request gets merged you will be able to Domoticz settings via a Setting dictionary from within a plugin.
What are you trying to achieve by accessing User Variables? These are designed for users to access during events from Lua and I can't think why you would access them from a plugin that interfaces to an external device.
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
-
- Posts: 81
- Joined: Sunday 04 January 2015 0:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest-1
- Location: /dev/null
- Contact:
Re: How to access settings
Thanks for the great news about the settings collection! I will pull it out of the Python-Plugins branch and test it asap.
About the uservariables, well, its more a dirty mind (from a programming point of view ) in the sense of an easy way of communicating with the plugin from the outside world via the json api. Of course pulling data is no problem but pushing data to the plugin, if needed, is fairly easy that way.
May be I should think about is a bit more and if I can find some real world benefits I will start a new topic on this.
Thanks again,
--Gerard
About the uservariables, well, its more a dirty mind (from a programming point of view ) in the sense of an easy way of communicating with the plugin from the outside world via the json api. Of course pulling data is no problem but pushing data to the plugin, if needed, is fairly easy that way.
May be I should think about is a bit more and if I can find some real world benefits I will start a new topic on this.
Thanks again,
--Gerard
-
- Posts: 81
- Joined: Sunday 04 January 2015 0:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest-1
- Location: /dev/null
- Contact:
Re: How to access settings
Update: Just did a quick test and I can access all settings/preferences now from my plugin!
Thanks again,
--Gerard
Thanks again,
--Gerard
-
- Posts: 51
- Joined: Thursday 26 January 2017 23:11
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: NL
- Contact:
Re: How to access settings
\o/Dnpwwo wrote:When "Add Settings collection #1289" pull request gets merged you will be able to Domoticz settings via a Setting dictionary from within a plugin.
I see it is already merged!!! Looking forward to this very much. I don't have to ask the users for their location and retrieve it from the settings. Hope to have some time soon to update my plugin to use this!
-
- Posts: 81
- Joined: Sunday 04 January 2015 0:01
- Target OS: Raspberry Pi / ODroid
- Domoticz version: latest-1
- Location: /dev/null
- Contact:
Re: How to access settings
Indeed, I already removed the lat/lon settings and retrieve them now from the system settings.
Who is online
Users browsing this forum: No registered users and 0 guests