Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR represents a complete architectural overhaul of the Otto IoT framework, introducing a new type-safe device abstraction layer with generics and redesigning the messaging system around a cleaner Registry pattern.
Key changes:
- Introduced a new
rules/package for business logic (toggle, follow patterns) - Completely redesigned
messenger/package with typed wiring and codec abstraction - Replaced singleton patterns with dependency injection via Registry
- Added MQTT client abstraction with Paho implementation
- Moved old implementation to
_archive/directory
Reviewed changes
Copilot reviewed 17 out of 37 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
rules/rules.go |
New rule runner for concurrent execution of device rules |
rules/toggle_on_rising.go |
Button-to-relay toggle rule with debouncing |
rules/follow.go |
Generic source-to-sink following rule |
messenger/registry.go |
Central registry for device management and MQTT wiring |
messenger/wire_typed.go |
Type-safe device wiring with codec support |
messenger/mqtt_client.go |
MQTT client interface abstraction |
messenger/mqtt/paho.go |
Paho MQTT client implementation with reconnect support |
messenger/topics.go |
Simplified topic scheme implementation |
messenger/payloads.go |
Status and metadata payload structures |
messenger/messenger.go |
Simplified messenger with subscription management |
messenger/codec/codec.go |
Codec interface for type conversion |
messenger/codec/json.go |
JSON codec implementation |
examples/demo/main.go |
Comprehensive demo showing new architecture |
examples/logging/main.go |
Logging configuration demonstration |
cmd/otto/main.go |
Updated main entry point (incomplete) |
go.mod |
Updated Go version and dependencies |
go.sum |
Updated dependency checksums |
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.
No description provided.