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

Update sql.py #264

Merged
merged 1 commit into from
Jul 23, 2021
Merged

Conversation

kushan-26
Copy link
Contributor

Update the script to accommodate binary values that read "0: inactive", "1: active" to "[0, 1]".

Update the script to accommodate binary values that read "0: inactive", "1: active" to "[0, 1]".
@ChristianTremblay
Copy link
Owner

This was done so the web interface was able to get some kind of "string" value if I remember correctly. If we change that, we will need to take care of the moment the device is reconnected from the DB to the BACnet network.

This was also a way to be closed to the "enum" side of thing where I was able to have the string equivalent of the value in the DB. It is not always easy to guess the state based on the value (was 0 occupied or 1 ?)

@kushan-26
Copy link
Contributor Author

I thought this only relates when it comes to saving to a sql database. Because "Inactive, Active" values will convert to [0, 1] right now. As I remember, initially this was done to take the mean value for resampling. However, now binary values are taking the last value for resampling. Even back then the values were not translated to original state upon reconnecting from database. This is my understanding. Have I misunderstood the process?

Also, Isn't the web interface use the internal history which has the string values?

@ChristianTremblay
Copy link
Owner

[cricket sound]

I think you are right.

@github-actions
Copy link

This pull request has not been processed yet, please proceed or close.

@ChristianTremblay
Copy link
Owner

I really need more time per day....

@github-actions
Copy link

This pull request has not been processed yet, please proceed or close.

@ChristianTremblay ChristianTremblay merged commit 2e87153 into ChristianTremblay:develop Jul 23, 2021
@ChristianTremblay
Copy link
Owner

@kushan-26 Please have a look to issue #291 as I need your input on what I came out to do.
Thanks

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

Successfully merging this pull request may close these issues.

2 participants