What if the source changes

Posted on
Sun Jul 25, 2021 5:23 am
davinci offline
Posts: 399
Joined: Feb 14, 2015

What if the source changes

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?

Posted on
Sun Jul 25, 2021 5:49 am
DaveL17 offline
User avatar
Posts: 5990
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: What if the source changes

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

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Sun Jul 25, 2021 6:56 am
davinci offline
Posts: 399
Joined: Feb 14, 2015

Re: What if the source changes

Good point.

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

Posted on
Mon Aug 02, 2021 7:00 pm
mundmc offline
User avatar
Posts: 837
Joined: Sep 14, 2012

Re: What if the source changes

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.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest