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

Add ConnectedDevices Box #253

Merged
merged 19 commits into from
Apr 20, 2024
Merged

Add ConnectedDevices Box #253

merged 19 commits into from
Apr 20, 2024

Conversation

danirabbit
Copy link
Member

@danirabbit danirabbit commented Feb 10, 2024

Screenshot from 2024-02-17 14 03 33

@danirabbit danirabbit changed the title Danirabbit/connected devices Add ConnectedDevices Box Feb 10, 2024
Comment on lines +191 to +192
if (model == "iPad") {
icon_name = "computer-tablet";
Copy link
Member Author

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

@danirabbit danirabbit requested a review from a team February 18, 2024 00:14
@danirabbit danirabbit marked this pull request as ready for review February 18, 2024 00:14
} 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;
Copy link
Member Author

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

Copy link

@zeebok zeebok left a 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!

@danirabbit danirabbit merged commit 2c3cd06 into main Apr 20, 2024
2 of 4 checks passed
@danirabbit danirabbit deleted the danirabbit/connected-devices branch April 20, 2024 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

2 participants