From b2524c8799423913ae7286218bceaaded3a16a3d Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Mon, 26 Dec 2022 17:45:38 -0500 Subject: [PATCH] Make `count` and `append_const` actions use `set_if` in icinga conf --- check_home_assistant_state.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/check_home_assistant_state.py b/check_home_assistant_state.py index 14a9c90..ca9d4c9 100755 --- a/check_home_assistant_state.py +++ b/check_home_assistant_state.py @@ -124,7 +124,14 @@ class Icinga2ConfAction(argparse.Action): if action.required: print(" required = true") - if isinstance(action, argparse._StoreConstAction): + if isinstance( + action, + ( + argparse._StoreConstAction, + argparse._CountAction, + argparse._AppendConstAction, + ), + ): print(f' set_if = "${command_name}_{icinga2_var}$"') else: print(f' value = "${command_name}_{icinga2_var}$"')