majorx234 / dooropen_api

OpenAPI generated doorstatus REST Backend
0 stars 0 forks source link

[FEATURE] callback function on pin change received #7

Open Nikl174 opened 1 year ago

Nikl174 commented 1 year ago

I think it whould be nice to have a callback function that gets called when ever a pin-change is receded for handling statechanges because in the current implementation only the current state is saved in the dictionary.

The callback function whould look like this:

fn callback(old_state: PinLevel, new_state: PinLevel)
{...}

But I'm currently not sure, how to implement it in a nice way.