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

Bootloader reset improvements #51

Merged
merged 7 commits into from
Dec 23, 2023
Merged

Bootloader reset improvements #51

merged 7 commits into from
Dec 23, 2023

Conversation

darkxst
Copy link
Contributor

@darkxst darkxst commented Dec 14, 2023

I have two more devices to add support for bootloader reset. The first is the Sonoff iHost included in this series, second will be a forthcoming device from Smlight.

The current bootloader reset implementation doesnt really scale cleanly for adding more devices, so I have split it out into a new --bootloader-reset option. I made it a global option so it can be shared with both probe and flash commands. Kept compatibility with the previous individual device flags, in case there is any usage from scripts currently.

@codecov-commenter
Copy link

codecov-commenter commented Dec 14, 2023

Codecov Report

Attention: 22 lines in your changes are missing coverage. Please review.

Comparison is base (3dbfc51) 60.71% compared to head (16622d2) 60.67%.

Files Patch % Lines
universal_silabs_flasher/flash.py 15.38% 11 Missing ⚠️
universal_silabs_flasher/flasher.py 21.42% 11 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev      #51      +/-   ##
==========================================
- Coverage   60.71%   60.67%   -0.05%     
==========================================
  Files          14       14              
  Lines        1642     1653      +11     
==========================================
+ Hits          997     1003       +6     
- Misses        645      650       +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@darkxst
Copy link
Contributor Author

darkxst commented Dec 21, 2023

Rebased on changes in dev branch now

@puddly
Copy link
Collaborator

puddly commented Dec 22, 2023

I've made a few changes to CI, as it looks like pre-commit hooks weren't running to check for formatting. You can re-format your code like so:

pip install pre-commit
pre-commit install
pre-commit run --all-files

@darkxst
Copy link
Contributor Author

darkxst commented Dec 22, 2023

ok, I have run the pre commit hooks and fixed errors detected.

@puddly
Copy link
Collaborator

puddly commented Dec 22, 2023

Thanks! Can you also revert the changes to gpio.py replacing the _send_gpio_pattern kwargs with pin_config: dict[str, typing.Any]? Passing an untyped dictionary to do the same isn't very Pythonic. It would be better to call the function with its original kwargs and parse the config dictionary within async def enter_bootloader_reset(self, target):.

@darkxst
Copy link
Contributor Author

darkxst commented Dec 23, 2023

sure, I have made that change as well.

@puddly puddly merged commit 4f7fff0 into NabuCasa:dev Dec 23, 2023
12 checks passed
robarnold referenced this pull request in marinatedconcrete/config Jan 4, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
|
[universal-silabs-flasher](https://togithub.com/NabuCasa/universal-silabs-flasher)
| `==0.0.15` -> `==0.0.16` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/universal-silabs-flasher/0.0.16?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/universal-silabs-flasher/0.0.16?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/universal-silabs-flasher/0.0.15/0.0.16?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/universal-silabs-flasher/0.0.15/0.0.16?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>NabuCasa/universal-silabs-flasher
(universal-silabs-flasher)</summary>

###
[`v0.0.16`](https://togithub.com/NabuCasa/universal-silabs-flasher/releases/tag/v0.0.16)

[Compare
Source](https://togithub.com/NabuCasa/universal-silabs-flasher/compare/v0.0.15...v0.0.16)

#### What's Changed

- Compatibility with gpiod 2.x by
[@&#8203;puddly](https://togithub.com/puddly) in
[https://github.com/NabuCasa/universal-silabs-flasher/pull/50](https://togithub.com/NabuCasa/universal-silabs-flasher/pull/50)
- Migrate to zigpy CI and pre-commit hooks by
[@&#8203;puddly](https://togithub.com/puddly) in
[https://github.com/NabuCasa/universal-silabs-flasher/pull/53](https://togithub.com/NabuCasa/universal-silabs-flasher/pull/53)
- Bootloader reset improvements by
[@&#8203;darkxst](https://togithub.com/darkxst) in
[https://github.com/NabuCasa/universal-silabs-flasher/pull/51](https://togithub.com/NabuCasa/universal-silabs-flasher/pull/51)
- Disconnect stream writer without closing the transport by
[@&#8203;puddly](https://togithub.com/puddly) in
[https://github.com/NabuCasa/universal-silabs-flasher/pull/58](https://togithub.com/NabuCasa/universal-silabs-flasher/pull/58)
- EBL parsing by [@&#8203;puddly](https://togithub.com/puddly) in
[https://github.com/NabuCasa/universal-silabs-flasher/pull/11](https://togithub.com/NabuCasa/universal-silabs-flasher/pull/11)
- Update README.md with bootloader reset option by
[@&#8203;darkxst](https://togithub.com/darkxst) in
[https://github.com/NabuCasa/universal-silabs-flasher/pull/54](https://togithub.com/NabuCasa/universal-silabs-flasher/pull/54)
- Run `isort` to fix CI by [@&#8203;puddly](https://togithub.com/puddly)
in
[https://github.com/NabuCasa/universal-silabs-flasher/pull/59](https://togithub.com/NabuCasa/universal-silabs-flasher/pull/59)

**Full Changelog**:
NabuCasa/universal-silabs-flasher@v0.0.15...v0.0.16

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/marinatedconcrete/config).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xMDMuMSIsInVwZGF0ZWRJblZlciI6IjM3LjEwMy4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants