Fix switchbotmeter for pullreq https://github.com/munin-monitoring/contrib/pull/1236
This commit is contained in:
parent
c21acdf249
commit
dd96f1861b
|
@ -33,6 +33,7 @@
|
|||
=head1 LICENSE
|
||||
|
||||
GPLv2
|
||||
SPDX-License-Identifier: GPL-2.0-only
|
||||
|
||||
=head1 Magic markers
|
||||
|
||||
|
@ -58,10 +59,6 @@ interval=${interval:-0}
|
|||
# Temperature unit
|
||||
tempunit=${tempunit:-C}
|
||||
|
||||
autoconf() {
|
||||
echo 'no'
|
||||
}
|
||||
|
||||
config() {
|
||||
cat <<EOF
|
||||
graph_title SwitchBot Meter ${deviceid}
|
||||
|
@ -103,7 +100,7 @@ fetch_api() {
|
|||
|
||||
statusCode=$( echo "${response}" | jq '.statusCode' )
|
||||
if [ "${statusCode}" -ne 100 ]; then
|
||||
echo Error with statusCode = "${statusCode}"
|
||||
echo Error with statusCode = "${statusCode}" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
@ -113,12 +110,11 @@ fetch_api() {
|
|||
|
||||
# Main
|
||||
case ${1:-} in
|
||||
autoconf)
|
||||
autoconf
|
||||
;;
|
||||
config)
|
||||
config
|
||||
[ "${MUNIN_CAP_DIRTYCONFIG:-}" = "1" ] && fetch
|
||||
if [ "${MUNIN_CAP_DIRTYCONFIG:-}" = "1" ]; then
|
||||
fetch
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
fetch
|
||||
|
|
Loading…
Reference in New Issue