Skip to content

Implement TemperatureThresholdWait trait#17

Merged
RobertZ2011 merged 1 commit intoOpenDevicePartnership:mainfrom
kurtjd:implement-threshold-trait
May 19, 2025
Merged

Implement TemperatureThresholdWait trait#17
RobertZ2011 merged 1 commit intoOpenDevicePartnership:mainfrom
kurtjd:implement-threshold-trait

Conversation

@kurtjd
Copy link
Contributor

@kurtjd kurtjd commented May 8, 2025

This PR implements the embedded-sensors TemperatureThresholdWait trait.

Unfortunately requires breaking existing interface, even when embedded-sensors-hal-async feature is not enabled. The alternative is to duplicate a lot of code and have a feature gate for the version that has the generic ALERT: embedded_hal_async::digital::Wait, but that does not seem worth it.

The other alternative which I'm open to is making wait_for_temperature_threshold require an ALERT pin as an argument, thus the Tmp108 struct wouldn't need a generic field for it. I was unsure about this, as having to pass a pin instantiation around until it gets to the call site might not be very ergonomic. Curious if others feel this is the better route though.

Driver might also benefit from additional typestate so polarity and thermostat mode don't need to be checked at runtime, which I'm open to implementing as well.

Resolves #15

@kurtjd
Copy link
Contributor Author

kurtjd commented May 8, 2025

@kjasani111 Welcome your input as well.

@kurtjd kurtjd force-pushed the implement-threshold-trait branch from 504aa45 to 5e48a12 Compare May 8, 2025 23:22
@kurtjd kurtjd force-pushed the implement-threshold-trait branch from 5e48a12 to d4ffbaa Compare May 8, 2025 23:31
@felipebalbi felipebalbi moved this to In progress in Embedded Controller May 9, 2025
@felipebalbi felipebalbi added the enhancement New feature or request label May 9, 2025
@kurtjd kurtjd force-pushed the implement-threshold-trait branch from d4ffbaa to 80cbe60 Compare May 9, 2025 17:40
@jeffglaum jeffglaum moved this from In progress to In review in Embedded Controller May 12, 2025
@kurtjd kurtjd force-pushed the implement-threshold-trait branch from 80cbe60 to 4da3b5c Compare May 16, 2025 20:53
@RobertZ2011 RobertZ2011 merged commit fde028a into OpenDevicePartnership:main May 19, 2025
12 checks passed
@github-project-automation github-project-automation bot moved this from In review to Done in Embedded Controller May 19, 2025
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

Status: Done

Development

Successfully merging this pull request may close these issues.

tmp108: Implement embedded-sensors TemperatureThresholdWait trait

3 participants