Skip to content

Commit

Permalink
Merge pull request #264 from kushan-26/patch-1
Browse files Browse the repository at this point in the history
Update sql.py
  • Loading branch information
ChristianTremblay committed Jul 23, 2021
2 parents 8ffe39a + 2abcd80 commit 2e87153
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions BAC0/sql/sql.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ def backup_histories_df(self, resampling="1s"):
if resampling_needed and "binary" in point.properties.type:
backup[point.properties.name] = (
point.history.replace(["inactive", "active"], [0, 1])
.replace(["0: inactive", "1: active"], [0, 1])
.resample(resampling_freq)
.last()
)
Expand All @@ -122,8 +123,9 @@ def backup_histories_df(self, resampling="1s"):
)
)
if "binary" in point.properties.type:
backup[point.properties.name] = point.history.replace(
["inactive", "active"], [0, 1]
backup[point.properties.name] = (
point.history.replace(["inactive", "active"], [0, 1])
.replace(["0: inactive", "1: active"], [0, 1])
)
elif "analog" in point.properties.type:
backup[point.properties.name] = point.history.resample(
Expand Down

0 comments on commit 2e87153

Please sign in to comment.