Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scripts/external_apis: add example external protocol script #2813

Merged
merged 11 commits into from
Feb 25, 2025

Conversation

sshambar
Copy link
Contributor

New scripts directory for external_apis, including one integrating the Enphase IQ Gateway web-API with NUT.

First draft of script addition discussed in issue #2807

New scripts directory for external_apis, including one integrating
the Enphase IQ Gateway web-API with NUT.

Signed-off-by: Scott Shambarger <[email protected]>
…ME.adoc: adjust wording in layman English parts of the text [networkupstools#2813]

Note that scripts/external_apis/enphase/README.adoc is not spell-checked
because it includes text from a bash script and its many variable names.

Signed-off-by: Jim Klimov <[email protected]>
ENPHASE_TOKENS="https://entrez.enphaseenergy.com/tokens"

msg() { printf '%s\n' "$*"; }
warn() { msg >&2 "$*"; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Never saw redirections ordered not in the end of command line, but this seems to work in bash at least :-)

@jimklimov jimklimov added this to the 2.8.3 milestone Feb 24, 2025
@jimklimov
Copy link
Member

Per #2807 (comment) :

Submitted a draft PR #2813 with a new directory scripts/external_apis and the enphase script/README etc in a subdirectory.

Looking for comments:

  • if you'd like a different directory name, or would prefer a standalone directory directly below scripts/

  • added a short README for the external_apis directory, and a "full" README in the enphase subdirectory

  • didn't add the "full" README to spellcheck, and it has lots of "shell-command" like things that don't check well...

I figured I'd checkin the current script as is, and if we add the new "stale file" features to dummy-ups, then I'll submit those additions in a later version as an option :)

Thanks, I'll brush it up a bit for better build integration (e.g. default paths from NUT's configure script can be built into your script if handled as a .in template). Likewise, path to installed script in the service unit should match where make install would place it (all if enabled somehow for installation at all, by e.g. a NUT configure option).

…xternal_apis/Makefile.am: introduce `configure --enable-extapi-enphase` installation [networkupstools#2813]

Signed-off-by: Jim Klimov <[email protected]>
…ader, parameterize installed script location and NUT run-time user [networkupstools#2813]

Signed-off-by: Jim Klimov <[email protected]>
…ternal_apis/enphase/enphase-monitor.in: parameterize config/state file locations to defaults with NUT configuration and locations made by package or make-install [networkupstools#2813]

Signed-off-by: Jim Klimov <[email protected]>
…nal_apis/enphase/README.adoc, fix corresponding typos or update the dictionary [networkupstools#2813]

Signed-off-by: Jim Klimov <[email protected]>
@jimklimov
Copy link
Member

@sshambar : most of NUT is licensed GPLv2+, WDYT about changing the wording in the PR'ed files to that (not v3+ to avoid surprises)?

@sshambar
Copy link
Contributor Author

@sshambar : most of NUT is licensed GPLv2+, WDYT about changing the wording in the PR'ed files to that (not v3+ to avoid surprises)?

That's fine, the script is really designed to work specifically with NUT, so aligning the licenses makes total sense.

@jimklimov jimklimov merged commit 5e4b733 into networkupstools:master Feb 25, 2025
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants