Skip to content

Embed devices.Base in GTU7 to implement complete Device interface#27

Closed
Copilot wants to merge 3 commits intogtu7from
copilot/sub-pr-16-35d6dea8-b59c-4846-a2ac-7067d207c36a
Closed

Embed devices.Base in GTU7 to implement complete Device interface#27
Copilot wants to merge 3 commits intogtu7from
copilot/sub-pr-16-35d6dea8-b59c-4846-a2ac-7067d207c36a

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jan 16, 2026

The GTU7 struct was missing the Events() method required by the Device interface. VH400 and other sensors implement this by embedding devices.Base.

Changes

  • Embed devices.Base in GTU7 struct to provide Name() and Events() methods
  • Initialize Base in NewGTU7 with event buffer size of 16
  • Emit lifecycle events in Run(): EventOpen at start, EventClose/EventError on exit, and close events channel

Example

// GTU7 now fully implements Device interface
var _ devices.Device = (*sensors.GTU7)(nil)
var _ devices.Source[sensors.GPSFix] = (*sensors.GTU7)(nil)

gps := NewGTU7(GTU7Config{...})
events := gps.Events()  // ✓ now available

go func() {
    for e := range events {
        log.Printf("%s: %s", e.Kind, e.Msg)
    }
}()

Pattern now matches VH400 and polling-based sensors.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits January 16, 2026 17:52
Co-authored-by: rustyeddy <2903425+rustyeddy@users.noreply.github.com>
Co-authored-by: rustyeddy <2903425+rustyeddy@users.noreply.github.com>
Copilot AI changed the title [WIP] Address feedback from PR #16 on Gtu7 sensor Embed devices.Base in GTU7 to implement complete Device interface Jan 16, 2026
Copilot AI requested a review from rustyeddy January 16, 2026 17:55
@rustyeddy rustyeddy closed this Jan 17, 2026
@rustyeddy rustyeddy deleted the copilot/sub-pr-16-35d6dea8-b59c-4846-a2ac-7067d207c36a branch January 17, 2026 16:34
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.

2 participants