Thanks for your work.
I was getting WPS-ENROLLEE-SEEN events, and it has more than three parameters, causing errors in the system log.
When I looked at https://w1.fi/wpa_supplicant/devel/ctrl_iface_page.html, it seems all Control interface events have: iface msg, but after that it varies, so it may be better to reverse the logic a bit to reduce errors in favour of warnings (or just ignore?).
function push_event {
logger -t $0 -p debug "push_event $@"
# iface=$1
msg=$2
config_get hass_timeout_conn global timeout_conn
config_get hass_timeout_disc global timeout_disc
case $msg in
"AP-STA-CONNECTED")
timeout=$hass_timeout_conn
;;
"AP-STA-POLL-OK")
timeout=$hass_timeout_conn
;;
"AP-STA-DISCONNECTED")
timeout=$hass_timeout_disc
;;
*)
logger -t $0 -p warning "push_event '$msg' not handled"
return
;;
esac
if [ "$#" -lt 3 ]; then
err_msg "Illegal number of push_event parameters"
exit 1
fi
mac=$3
post $(build_payload "$mac" "$(get_host_name $mac)" "$timeout")
}
IMO, you can get rid of the if block altogether? And maybe the warning too?
Thanks for your work.
I was getting
WPS-ENROLLEE-SEENevents, and it has more than three parameters, causing errors in the system log.When I looked at https://w1.fi/wpa_supplicant/devel/ctrl_iface_page.html, it seems all Control interface events have: iface msg, but after that it varies, so it may be better to reverse the logic a bit to reduce errors in favour of warnings (or just ignore?).
IMO, you can get rid of the
ifblock altogether? And maybe thewarningtoo?