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

Loop over multiple UPS's does not interate over individual values #7

Open
JPSteindlberger opened this issue Sep 8, 2024 · 0 comments

Comments

@JPSteindlberger
Copy link

JPSteindlberger commented Sep 8, 2024

Although having configured multiple UPS's in NUT, in MQTT I found unique values for all those UPS's. For my purpose I fixed it in pkg/nut_client/nut_client.go this way:

for num := range upsList {
- upsVariables, err := upsList[0].GetVariables()
+ upsVariables, err := upsList[num].GetVariables()
if err != nil {

But as I'm not a Go developer I cannot tell whether this has negative impact to the error handling of this block. There might be a reason for using upsList[0] instead of upsList[num]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant