Update Broker
This commit is contained in:
@@ -32,13 +32,17 @@ namespace PlantBox.Broker
|
||||
HistoricManager = new HistoricManager()
|
||||
};
|
||||
}
|
||||
|
||||
plantBox.ID = id;
|
||||
plantBox.Name = infoResponse.Name;
|
||||
plantBox.Type = infoResponse.Type;
|
||||
plantBox.State = infoResponse.State;
|
||||
plantBox.Humidity = new CaptorValue(infoResponse.HumidityMin, infoResponse.HumidityMax, plantBox.Humidity?.Value ?? 0);
|
||||
plantBox.Luminosity = new CaptorValue(infoResponse.LuminosityMin, infoResponse.LuminosityMax, plantBox.Luminosity?.Value ?? 0);
|
||||
plantBox.Temperature = new CaptorValue(infoResponse.TemperatureMin, infoResponse.TemperatureMax, plantBox.Temperature?.Value ?? 0);
|
||||
|
||||
plantBox.UpdateState();
|
||||
|
||||
Broker.PlantBoxesManager.Add(plantBox);
|
||||
}
|
||||
|
||||
protected override void CaptorsCommand(CommandStream commandStream, CommandPacket packet)
|
||||
@@ -59,6 +63,8 @@ namespace PlantBox.Broker
|
||||
plantBox.Temperature.Value = captorsResponse.Temperature;
|
||||
plantBox.TankLevel = captorsResponse.Tank;
|
||||
|
||||
plantBox.UpdateState();
|
||||
|
||||
plantBox.HistoricManager.Add(new CaptorsValue(plantBox.Humidity.Value, plantBox.Luminosity.Value, plantBox.Temperature.Value));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user