Skip to content

Conversation

davide125
Copy link

@davide125 davide125 commented Aug 19, 2025

Add support for the TSL2561 light sensor. Related protobufs PR: meshtastic/protobufs#756

🤝 Attestations

  • I have tested that my proposed changes behave as described.
  • I have tested that my proposed changes do not cause any obvious regressions on the following devices:
    • Station G2

@CLAassistant
Copy link

CLAassistant commented Aug 19, 2025

CLA assistant check
All committers have signed the CLA.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@thebentern thebentern requested a review from Copilot August 19, 2025 10:36
@thebentern thebentern added the enhancement New feature or request label Aug 19, 2025
Copy link
Contributor

@Copilot 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 adds support for the TSL2561 digital light sensor to the Meshtastic telemetry system. The implementation includes sensor detection, initialization, and data collection for lux measurements.

Key changes:

  • New TSL2561Sensor class implementation with proper initialization and metric collection
  • Updated I2C device detection to differentiate between TSL2561 and TSL2591 sensors sharing the same address
  • Integration with the EnvironmentTelemetry module for automatic sensor polling and data reporting

Reviewed Changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/modules/Telemetry/Sensor/TSL2561Sensor.h Header file defining the TSL2561Sensor class interface
src/modules/Telemetry/Sensor/TSL2561Sensor.cpp Implementation of TSL2561 sensor functionality including setup and metric collection
src/modules/Telemetry/EnvironmentTelemetry.cpp Integration of TSL2561 sensor into the telemetry polling and data collection system
src/main.cpp Registration of TSL2561 device type for I2C scanning
src/detect/ScanI2CTwoWire.cpp Enhanced I2C detection logic to distinguish TSL2561 from TSL2591 sensors
src/detect/ScanI2C.h Added TSL2561 device type enumeration
protobufs Updated protobuf submodule reference
platformio.ini Added Adafruit TSL2561 library dependency

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

thebentern and others added 3 commits August 19, 2025 06:00
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@thebentern
Copy link
Contributor

@davide125 can you resolve the conflicts in the protobufs submodule ref? I updated master with the changes

@davide125
Copy link
Author

Thanks! I've pushed a commit to update protobufs now, I can also squash everything if that makes for an easier merge, just let me know.

@fifieldt
Copy link
Member

Hi @davide125 , we'll squash on merge, so no need to do that :)

Are you familar with the trunk code linter? we use that to keep our formatting consistent. If you use vscode you can just add the plugin and will automatically fix everything up.

@davide125
Copy link
Author

Ah, I don't use vscode but I've installed trunk and done a pass with it now, just pushed a fix for the issue it found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants