diff --git a/src/transform.py b/src/transform.py index d2a5843..8547667 100644 --- a/src/transform.py +++ b/src/transform.py @@ -64,14 +64,14 @@ class Transform: on_state = len(sensor_data[date]["on"]) off_state = len(sensor_data[date]["off"]) activations = (on_state + off_state) / 2 + if on_state != off_state: # print("Error: On and off states are not equal", name, date) tmp[name]["x"].append(date) - tmp[name]["y"].append(activations if activations > 1 else 0) + tmp[name]["y"].append(activations) else: # add the date to the tmp dictionary as x and the number of activations, divided by two as y - activations = (on_state + off_state) / 2 tmp[name]["x"].append(date) tmp[name]["y"].append(activations if activations > 1 else 0) # print(tmp)