jasonsnell / PurpleAir-AQI-Scriptable-Widget

Generate Scriptable app widget to query PurpleAir sensor and display local AQI.
The Unlicense
168 stars 38 forks source link

Support Private Sensors #29

Closed lehrblogger closed 3 years ago

lehrblogger commented 3 years ago

I have an indoor sensor that I'd prefer to configure with PurpleAir as private, rather than public, and it would be great to see its reading in an iOS widget.

At a glance, this may be a simple as adding an optional key configuration variable that gets appended to the API requests. Hopefully I can take a stab at a PR in the next few weeks.

jasonsnell commented 3 years ago

It's very simple to do that, but there won't be any interface for it. So you'd need to configure it in the code of the widget itself. I've avoided it up to now just because it requires that extra level, but it should probably be added as an option.

jasonsnell commented 3 years ago

@lehrblogger you can test this out with the version in the optional-key branch, if you like.

lehrblogger commented 3 years ago

@jasonsnell That seems to be working well, thank you! Maybe at some point Scriptable will support more than one widgetParameter.

Does the purpleMapUrl need the key as well?

jasonsnell commented 3 years ago

All merged, thanks @lehrblogger. I'd like to sense when it's an indoor station and maybe display different graphics or something, but that's not something I'm prepared to work on right now...

lehrblogger commented 3 years ago

Great! And that's interesting idea. So far I only have this one indoor sensor so don't personally need the visual differentiation, but I'll keep this in mind.

Thanks for such a useful widget!