Spaces:
Sleeping
Sleeping
from energy_prediction.EnergyPredictionNorth import EnergyPredictionNorth | |
from energy_prediction.EnergyPredictionSouth import EnergyPredictionSouth | |
from energy_prediction.EnergyPredictionPipeline import EnergyPredictionPipeline | |
def main(): | |
# Energy Prediction North wing | |
EnergyPredictionNorth = EnergyPredictionNorth( | |
model_path="src/energy_prediction/models/lstm_energy_north_01.keras" | |
) | |
# Energy Prediction South wing | |
def on_message(client, userdata, message): | |
df = EnergyPredictionPipeline.fit(message) | |
if not df is None: | |
out_vav = EnergyPredictionNorth.pipeline( | |
df, EnergyPredictionPipeline.scaler | |
) | |
broker_address = "localhost" | |
broker_port = 1883 | |
topic = "sensor_data" | |
client = mqtt.Client(mqtt.CallbackAPIVersion.VERSION1) | |
print("Connecting to broker") | |
client.on_message = on_message | |
client.connect(broker_address, broker_port) | |
client.subscribe(topic) | |
client.loop_forever() | |
if __name__ == "__main__": | |
main() | |