Skip to content

feat: migrate smoke and gas detector input plugin to Go - #2662

Open
Wanbogang wants to merge 1 commit into
OpenMind:mainfrom
Wanbogang:feature/smoke-gas-detector-go
Open

feat: migrate smoke and gas detector input plugin to Go#2662
Wanbogang wants to merge 1 commit into
OpenMind:mainfrom
Wanbogang:feature/smoke-gas-detector-go

Conversation

@Wanbogang

Copy link
Copy Markdown
Contributor

Summary

Migrates the Smoke and Gas Detector input plugin from the deprecated Python runtime (#2481) to Go, per @Prachi1615's request.

Scope

This PR includes the mock connector only. Real hardware backends (Arduino MQ serial, ENS160 I2C, SGP30 I2C) require new Go dependencies not currently in go.mod, which per CONTRIBUTING.md need discussion in an issue before adding. These will follow in a separate PR.

What's included

  • SmokeGasDetector input plugin (plugins/inputs/smoke_gas_detector.go)
  • Classify logic (normal/warning/danger) and cooldown behavior ported 1:1 from the Python version
  • Unit tests (plugins/inputs/smoke_gas_detector_test.go)
  • Example config (config/smoke_gas_detector.json5)

Testing

  • make build
  • make vet
  • make test — all pass, no regressions ✅
  • Manual run verified alert output and cooldown timing end-to-end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config Configuration files go plugins tests Test files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant