luci-mod-battstatus: Add photonicat support#585
Merged
1715173329 merged 1 commit intoimmortalwrt:masterfrom Sep 9, 2025
rbqvq:battstatus-pcat
Merged
luci-mod-battstatus: Add photonicat support#5851715173329 merged 1 commit intoimmortalwrt:masterfrom rbqvq:battstatus-pcat
1715173329 merged 1 commit intoimmortalwrt:masterfrom
rbqvq:battstatus-pcat
Conversation
Add photonicat support with pcat-mgr Signed-off-by: Coia Prant <coiaprant@gmail.com>
1715173329
reviewed
Sep 5, 2025
Comment on lines
+13
to
+14
| board=$(cat /tmp/sysinfo/board_name) | ||
| model=$(cat /tmp/sysinfo/model) |
Member
There was a problem hiding this comment.
Suggested change
| board=$(cat /tmp/sysinfo/board_name) | |
| model=$(cat /tmp/sysinfo/model) | |
| board="$(cat /tmp/sysinfo/board_name)" | |
| model="$(cat /tmp/sysinfo/model)" |
Comment on lines
+21
to
+22
| json_add_boolean charging $(cat /sys/class/power_supply/pcat-charger/online) | ||
| json_add_int percentage $(cat /sys/class/power_supply/pcat-battery/capacity) |
Member
There was a problem hiding this comment.
Suggested change
| json_add_boolean charging $(cat /sys/class/power_supply/pcat-charger/online) | |
| json_add_int percentage $(cat /sys/class/power_supply/pcat-battery/capacity) | |
| json_add_boolean charging "$(cat /sys/class/power_supply/pcat-charger/online)" | |
| json_add_int percentage "$(cat /sys/class/power_supply/pcat-battery/capacity)" |
| hootoo,ht-tm05) | ||
| if [ -f /usr/sbin/i2cset ] && [ -f /usr/sbin/i2cget ]; then | ||
| json_add_boolean valid 1 | ||
| if [ $(i2cset -y 0 0x0a 0x0a 0x01 && i2cget -y 0 0x0a 0x0a) = 0x40 ]; then |
Member
There was a problem hiding this comment.
Suggested change
| if [ $(i2cset -y 0 0x0a 0x0a 0x01 && i2cget -y 0 0x0a 0x0a) = 0x40 ]; then | |
| if [ "$(i2cset -y 0 0x0a 0x0a 0x01 && i2cget -y 0 0x0a 0x0a)" = "0x40" ]; then |
| else | ||
| json_add_boolean charging 0 | ||
| fi | ||
| json_add_int percentage $(i2cset -y 0 0x0a 0x0a 0x10 && i2cget -y 0 0x0a 0x0a | xargs printf %d) |
Member
There was a problem hiding this comment.
Suggested change
| json_add_int percentage $(i2cset -y 0 0x0a 0x0a 0x10 && i2cget -y 0 0x0a 0x0a | xargs printf %d) | |
| json_add_int percentage "$(i2cset -y 0 0x0a 0x0a 0x10 && i2cget -y 0 0x0a 0x0a | xargs printf "%d")" |
| json_add_string message "Need i2cset" | ||
| ;; | ||
| hootoo,ht-tm05) | ||
| if [ -f /usr/sbin/i2cset ] && [ -f /usr/sbin/i2cget ]; then |
| else | ||
| json_add_string message "Need i2cget" | ||
| json_add_boolean valid 0 | ||
| if [ ! -f /usr/sbin/i2cset ]; then |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Add photonicat support with pcat-mgr