Page 1 of 1

What if the source changes

PostPosted: Sun Jul 25, 2021 5:23 am
by davinci
Let's assume the source is changing a variable name or doesn't support it anymore.
How can I be sure that all variables are still active?

I guess the plugin could check if there is a change in the table and if there is one it could make a timestamp. Like this we could monitor this new variable/devicestate and check if there is an unexpected change.

What do you think about this?

Re: What if the source changes

PostPosted: Sun Jul 25, 2021 5:49 am
by DaveL17
How can I be sure that all variables are still active?

You can't. The plugin doesn't explicitly track whether a particular API construct changes. The purpose of the plugin is simply to take an external API source and make it available in Indigo. That is by design (and why it's called GhostXML).

APIs really shouldn't change very much in ways that will break things. Good practice demands that source APIs be static--new data points are just fine of course, but existing ones shouldn't really change that much--if at all. To change an existing API data source means that the provider runs the risk of breaking everything that uses its data. Not a good idea. For APIs that are truly dynamic, I wouldn't recommend linking directly to custom GhostXML device at all. I'd recommend using a Python script (that you control) that suits your needs specifically. In that script you can pick and choose what you want and control for missing data points.

API Source --> GhostXML Plugin --> Your Script --> Indigo Processing

Re: What if the source changes

PostPosted: Sun Jul 25, 2021 6:56 am
by davinci
Good point.

I guess OpenweatherMap will not change the API constantly. :)

Re: What if the source changes

PostPosted: Mon Aug 02, 2021 7:00 pm
by mundmc
I use GhostXML for New Jersey Transit, and it routinely changes the number of fields (based on remaining trains traveling that day). That said, other than SQLlogger throwing a bunch of messages whenever this changes, it hasn’t been a problem.