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 'get_battery_info' method to the SoCo class #756

Merged
merged 1 commit into from Nov 16, 2020
Merged

Conversation

pwt
Copy link
Contributor

@pwt pwt commented Nov 14, 2020

This PR addresses #723.

I've only tested against a Move on my S2 system, and there are indications that this approach doesn't work with S1 systems. It would be useful if someone could test this.

@pwt pwt self-assigned this Nov 14, 2020
@coveralls
Copy link

coveralls commented Nov 14, 2020

Coverage Status

Coverage decreased (-0.3%) to 57.518% when pulling a5dd0c0 on pwt:battery_info into b6c88d7 on SoCo:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.2%) to 57.509% when pulling cda193c on pwt:battery_info into ecb9112 on SoCo:master.

@KennethNielsen
Copy link
Member

KennethNielsen commented Nov 15, 2020

I think I have a mixed S1 and S2, but I don't have any devices with battery :(

In any case. Since the code reaches fairly wide, when the feature is not supported, I would be ok to merge it even without testing on S1 and then improve if anyone opens up an issue saying it doesn't work on S1 but should. There isn't much more we can do without more data or testing. What do you think @pwt ?

@pwt
Copy link
Contributor Author

pwt commented Nov 15, 2020

I think I have a mixed S1 and S2, but I don't have any devices with battery :(

I factory reset my Move and attempted to add it to my S1 system for testing. However, it looks like there's a bug in the current Sonos S1 iOS/iPadOS controller apps, meaning the process gets stuck when adding WiFi creds. Fortunately, I was able to add it back to my S2 system without any issues.

In any case. Since the code reaches fairly wide, when the feature is not supported, I would be ok to merge it even without testing on S1 and then improve if anyone opens up an issue saying it doesn't work on S1 but should. There isn't much more we can do without more data or testing. What do you think @pwt ?

Yes, I agree. It's not as if it's a mission-critical feature :)

@pwt pwt marked this pull request as draft November 15, 2020 16:25
@pwt pwt marked this pull request as ready for review November 15, 2020 17:19
@pwt pwt force-pushed the battery_info branch 2 times, most recently from 452dead to 7c8ede5 Compare November 15, 2020 18:15
@KennethNielsen
Copy link
Member

Do you want to add a software test for it or should I review as is?

@pwt
Copy link
Contributor Author

pwt commented Nov 16, 2020

Do you want to add a software test for it or should I review as is?

I'm not planning to add a test for this one.

@pwt
Copy link
Contributor Author

pwt commented Nov 16, 2020

Note that I could test explicitly for whether the target speaker is a Move, and avoid the network call if it isn't.

I chose not to do this because if additional battery-powered speakers arrive, there's a good chance that this call will work without change for these new speakers.

Copy link
Member

@KennethNielsen KennethNielsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have one minor suggestion, but it is approved as is if you don't agree.

soco/core.py Outdated Show resolved Hide resolved
@pwt pwt merged commit 5ff711f into SoCo:master Nov 16, 2020
@pwt pwt mentioned this pull request Nov 16, 2020
@pwt pwt deleted the battery_info branch November 16, 2020 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants