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

Respect scrutiny device status threshold setting #620

Merged
merged 5 commits into from
Dec 5, 2022

Conversation

Tarow
Copy link
Contributor

@Tarow Tarow commented Dec 4, 2022

This PR addresses the issue mentioned here.

The scrutiny widget now respects the device status threshold setting when calculating the number of failed and passed devices.

@shamoon
Copy link
Collaborator

shamoon commented Dec 4, 2022

Thanks for the PR! This wasnt working as-submitted though, it was missing the "passing" condition where the status was > threshold, e.g. in my case 2 drives failing scrutiny but passing SMART, so status returns 2 and threshold is 1 yet it was still showing passed: 0.

I also simplified the code, I dont think we need the Map.

Let me know if youre good with these changes! Feel free, of course.

@Tarow
Copy link
Contributor Author

Tarow commented Dec 5, 2022

Good catch, thanks for the changes!

You are right when it comes to the map. It's not really necessary but i thought semantically it makes more sense to map the DeviceStatusThreshold back to a DeviceStatus, as now what we are doing is [DeviceStatusThreshold,DeviceStatus].includes(DeviceStatus), which works ofc, as the numbers match in this case.

Right now, the failed condition can collide with the unknown condition as device status 4 (assuming that could happen) and threshold both would be counted both as failed and unknown.

I made some minor adjustments, let me know what you think.

@shamoon
Copy link
Collaborator

shamoon commented Dec 5, 2022

Yes we are definitely down into the semantic weeds. Anyway, I dont see these things changing any time soon. Thanks.

@shamoon shamoon merged commit 826fe15 into gethomepage:main Dec 5, 2022
Copy link
Contributor

github-actions bot commented Feb 6, 2024

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion for related concerns.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 6, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants