-
-
Notifications
You must be signed in to change notification settings - Fork 13
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 ConnectedDevices Box #253
Conversation
danirabbit
commented
Feb 10, 2024
•
edited
edited
f3d4c86
to
f0195d7
Compare
if (model == "iPad") { | ||
icon_name = "computer-tablet"; |
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.
This is obviously kind of a dirty little hack. I can remove this. It doesn't seem like there's a good way to figure out if the attached device is a tablet or laptop
} catch (IOError e) { | ||
critical (e.message); | ||
} | ||
} | ||
|
||
private void update_properties () { | ||
coarse_battery_level = upower_device.battery_level != 1; | ||
|
||
model = upower_device.model; // Can sometimes update eg when phone is trusted | ||
percentage = upower_device.percentage; |
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.
We should probably check for coarse battery level here and if we can get a coarse battery level we should set percentage to reflect that level since percentage can be inaccurate in those cases
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.
Haven't tested but the code looks good!