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

Bump pySwitchbot to 0.19.15 #79972

Merged
merged 2 commits into from
Oct 10, 2022
Merged

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Oct 10, 2022

Proposed change

Switchbot curtain groups use one set of commands, while some devices use another set of commands. Since we don't know which command set to use (and there is no documentation available for these), we now send both. I ended up buying a second switchbot curtain device to make this sure this strategy works. With sending both command sets the device works in grouped mode to control both curtains, and ungrouped mode to control itself only.

This originally broke in #78857 when the command set was changed

The hope is that by sending both commands we won't regress #78175 but since I could never replicate the issue I can't be sure it won't, but this seems like a better strategy than a full revert which was the other option.

fixes #79827

changelog: sblibs/pySwitchbot@0.19.13...0.19.15

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Black (black --fast homeassistant tests)
  • Tests have been added to verify that the new code works.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

To help with the load of incoming pull requests:

@homeassistant
Copy link
Contributor

Hey there @Danielhiversen, @RenierM26, @murtas, @Eloston, mind taking a look at this pull request as it has been labeled with an integration (switchbot) you are listed as a code owner for? Thanks!

@RenierM26
Copy link
Contributor

Hi @bdraco,

deviceChain": 1, in the adv data should indicate if the curtain is grouped or not.

Can't remember if it's 1 for single device or 0.

I was looking at a way to determine the "master" to simplify the discovery and device setup but could not test all the combinations.

@bdraco bdraco marked this pull request as draft October 10, 2022 06:47
@bdraco bdraco removed this from the 2022.10.3 milestone Oct 10, 2022
@bdraco
Copy link
Member Author

bdraco commented Oct 10, 2022

Thanks @RenierM26 I’ll do some more experimenting in the morning

@bdraco bdraco closed this Oct 10, 2022
@bdraco bdraco deleted the switchbot_bump15 branch October 10, 2022 06:48
@bdraco
Copy link
Member Author

bdraco commented Oct 10, 2022

@RenierM26 bit 4 here seems to indicate if it’s a child device but I’m not 100% sure that’s correct as the documentation is a bit unclear / lacking

sblibs/pySwitchbot#128

@bdraco
Copy link
Member Author

bdraco commented Oct 10, 2022

@RenierM26 it seems to be set even if it's not grouped for me. The docs say it's the length of the chain but it seems to always be 1 for both the group and ungrouped ones

@bdraco bdraco restored the switchbot_bump15 branch October 10, 2022 19:05
@bdraco bdraco reopened this Oct 10, 2022
@bdraco
Copy link
Member Author

bdraco commented Oct 10, 2022

I checked another device and deviceChain is set even if its not grouped so I'm going to move forward this solution at it seems to have the best chance to solving the issue

Oct 10 19:07:24 homeassistant homeassistant[486]: 2022-10-10 14:07:24.207 DEBUG (MainThread) [homeassistant.components.switchbot.coordinator] C1:C7:27:7D:55:AB: Switchbot data: {'rawAdvData': b'c\xd0X\x00!\x04', 'data': {'calibration': True, 'battery': 88, 'inMotion': False, 'position': 100, 'lightLevel': 2, 'deviceChain': 1}, 'model': 'c', 'isEncrypted': False, 'modelFriendlyName': 'Curtain', 'modelName': <SwitchbotModel.CURTAIN: 'WoCurtain'>}

@bdraco bdraco added this to the 2022.10.3 milestone Oct 10, 2022
@bdraco bdraco marked this pull request as ready for review October 10, 2022 19:08
@frenck frenck merged commit b3ad0ee into home-assistant:dev Oct 10, 2022
frenck pushed a commit that referenced this pull request Oct 10, 2022
@frenck frenck mentioned this pull request Oct 10, 2022
@dadcoachengineer
Copy link

Was hoping this would fix reliability issues with my switchbot curtains. Running a set of them as a pair driven by ESP bluetooth proxies.

@bdraco - Happy to provide any logs or contribute to another issue or PR if relevant.

@frenck
Copy link
Member

frenck commented Oct 11, 2022

@dadcoachengineer This is a merged PR, which might not be the ideal place to report issues. If you are still experiencing issues, please, open an issue instead (as that can be tracked, until the issues closes).

@github-actions github-actions bot locked and limited conversation to collaborators Oct 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switchbot curtain group only 1 curtain is opened/closed
6 participants