-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
Add web UI notification for under voltage/throttling events #1203
Merged
Merged
Changes from 13 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
3749d15
add web UI notification for under voltage/throttling events
benjamink 9e75ffb
fix branch name in readme
benjamink 1d42500
support internalization of messages
benjamink 5c5adb0
rework for internalization
benjamink 1bcd64b
update translation messages
benjamink 34edf69
fix ReturnCodeMapper lookup
benjamink 8793ad0
add mock command for vcgencmd
benjamink 280736f
Revert "update translation messages"
benjamink e19fa08
fix syntax/typos
benjamink 355ca21
fix syntax/typos
benjamink e9417e1
fix syntax/typos
benjamink 3999f38
fix syntax
benjamink 0bd2a4b
add throttle notification unittest
benjamink d12424b
fix return code text
benjamink 620a7cc
make messages more descriptive
benjamink 041ad46
add vcgencmd to web/requirements.txt
benjamink File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
protobuf==3.19.5 | ||
requests==2.31.0 | ||
vcgencmd==0.1.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Info: https://www.raspberrypi.com/documentation/computers/os.html#vcgencmd | ||
# | ||
# Bit Hex value Meaning | ||
# ----- ----------- ------------------------ | ||
# 0 0x1 Under-voltage detected | ||
# 1 0x2 Arm frequency capped | ||
# 2 0x4 Currently throttled | ||
# 3 0x8 Soft temperature limit active | ||
# 16 0x10000 Under-voltage has occurred | ||
# 17 0x20000 Arm frequency capping has occurred | ||
# 18 0x40000 Throttling has occurred | ||
# 19 0x80000 Soft temperature limit has occurred | ||
|
||
if [[ "$1" == "get_throttled" ]] | ||
then | ||
# Return 'Under-voltage detected' & 'Under-voltage has occurred' | ||
echo "throttled=0x10001" | ||
fi | ||
|
||
echo "Mock does not recognize: $0 $@" | ||
exit 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,6 +50,22 @@ class ReturnCodeMapper: | |
_("No files were extracted (existing files are skipped)"), | ||
ReturnCodes.EXTRACTIMAGE_COMMAND_ERROR: | ||
_("Unable to extract archive: %(error)s"), | ||
ReturnCodes.UNDER_VOLTAGE_DETECTED: | ||
_("Under voltage detected"), | ||
ReturnCodes.ARM_FREQUENCY_CAPPED: | ||
_("Arm frequency capped"), | ||
ReturnCodes.CURRENTLY_THROTTLED: | ||
_("Currently throttled"), | ||
ReturnCodes.SOFT_TEMPERATURE_LIMIT_ACTIVE: | ||
_("Soft-temperature limit active"), | ||
ReturnCodes.UNDER_VOLTAGE_HAS_OCCURRED: | ||
_("Under voltage has occured"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One remaining typo here! (should say "occurred") |
||
ReturnCodes.ARM_FREQUENCY_CAPPING_HAS_OCCURRED: | ||
_("Arm frequency capping has occurred"), | ||
ReturnCodes.THROTTLING_HAS_OCCURRED: | ||
_("Throttling has occurred"), | ||
ReturnCodes.SOFT_TEMPERATURE_LIMIT_HAS_OCCURRED: | ||
_("Soft temperature limit has occurred"), | ||
} | ||
# fmt: on | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should "Arm" be all uppercase?