Skip to content

Devices v2 - complete revamp.#80

Merged
rustyeddy merged 3 commits intomainfrom
devices-v2
Jan 9, 2026
Merged

Devices v2 - complete revamp.#80
rustyeddy merged 3 commits intomainfrom
devices-v2

Conversation

@rustyeddy
Copy link
Copy Markdown
Owner

No description provided.

@rustyeddy rustyeddy self-assigned this Jan 9, 2026
Copilot AI review requested due to automatic review settings January 9, 2026 02:44
@rustyeddy rustyeddy added the Architecture Design decisions. label Jan 9, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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

@rustyeddy rustyeddy merged commit 4b1b54f into main Jan 9, 2026
7 of 8 checks passed
@rustyeddy rustyeddy deleted the devices-v2 branch January 9, 2026 03:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Architecture Design decisions.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants