Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic Temperature and Humidty PayloadConvert functions #917

Closed

Conversation

t-huyeng
Copy link
Contributor

@t-huyeng t-huyeng commented Nov 16, 2022

I was looking for an easy way to send temperature and humidity data. Since I did not find the right PayloadConvert for this, I just added one.

This function can be used for any user specific sensor which measures temperature and humidity.

@cyberman54 what are your thoughts on such generic function?

FYI: I currently tested only the packed format function.

@t-huyeng
Copy link
Contributor Author

Since all checks (github action) are starting for this pull-request I think we could also change the workflow again that only a few boards get tested during a pull request.

What about:

  • ttgov21new.h
  • generic.h
  • heltecv21.h

Or any other boards?

@cyberman54
Copy link
Owner

Yes, we can merge this, no problem.
But wouldn't it be kind of dead code without a sensor usecase & hal file?

@t-huyeng
Copy link
Contributor Author

Yes that is probably true. I could add the function as a comment in the sensor.cpp. This still means that the code is not really used.

I used it for my gy21 see this.

Maybe an example for a custom sensor would also be at least a start (in the readme or in an extra example folder ).

@cyberman54
Copy link
Owner

Let's complete this as an example for integration of a custom sensor, good idea!

Originally paxcounter had one use: count pax. But there were many users who added functions. Now the code is kind of multi use case. Not good since it growed step by step and, thus, is not a platform approach. But seems to work as is for many users and their use cases. That's why i think the sensor example makes sense.

@t-huyeng
Copy link
Contributor Author

I see what you mean and I think you are right.
For me it would also be okay if we do not merge this (this is why a made this a draft as well). I will try to work on an example in the next days and maybe we can just leave this in my fork and add it to the readme here or something like that.

I am actually using this project as a "template" since I feel there is no better project with so many configuration out there.

@t-huyeng
Copy link
Contributor Author

I added and update most of this code to the docs.
See: https://t-huyeng.github.io/ESP32-Paxcounter/configuration/custom-sensors/
or: https://github.com/t-huyeng/ESP32-Paxcounter/blob/mkdocs/docs/configuration/custom-sensors.md

So I would suggest to close this PR and keep the code in the docs.

@cyberman54
Copy link
Owner

ok & thx!

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