Update __init__.py - Error correction + fix PCF8574 multi-output overwrite + I2C lock + persistence + multi-device support#4
Open
gumazza wants to merge 1 commit into
Open
Conversation
### Summary This PR fixes a critical issue where activating one PCF8574 output would unintentionally disable the others. ### Changes - Write full 8-bit state to PCF8574 (required by hardware) - Added async I2C bus lock - Added persistent state across CBPi4 restarts - Added support for multiple PCF8574 devices (0x20–0x27) - Added sequential relay test action - Updated CBPi4 API imports (CBPiActor) ### Hardware tested - Raspberry Pi 4 - PCF8574 - ULN2803 relay driver - Relays active LOW ### Result - Outputs are now fully independent - Multiple relays can be active simultaneously - Stable behavior under concurrent actor updates
Member
|
I will look into it, but it'll take some time as I will be travelling the next coouple of days. Quick question after brief review: Where do you get the "/tmp/pcf8574_state.json" file from. This might not be working for others. |
Author
|
It was a suggestion from chatGPT. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes a critical issue where activating one PCF8574 output would unintentionally disable the others.
Changes
Hardware tested
Result