From c43a0a25bf3e7738ea5f037043665ea80c0b297c Mon Sep 17 00:00:00 2001 From: avollkopf <43980694+avollkopf@users.noreply.github.com> Date: Wed, 3 Nov 2021 12:53:34 +0100 Subject: [PATCH] Fix for StrikeTemp in case you operate system in F BF i sending all temps in C and striketemp needs to be converterd to F if cbpi4 is running in F --- cbpi/controller/upload_controller.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cbpi/controller/upload_controller.py b/cbpi/controller/upload_controller.py index c523b47..dcfcba8 100644 --- a/cbpi/controller/upload_controller.py +++ b/cbpi/controller/upload_controller.py @@ -470,7 +470,11 @@ class UploadController: try: StrikeTemp=bf_recipe['data']['strikeTemp'] except: - StrikeTemp = None + StrikeTemp = None + # BF is sending all Temeprature values in °C. If system is running in F, values need to be converted + if StrikeTemp is not None and self.TEMP_UNIT != "C": + StrikeTemp = round((9.0 / 5.0 * float(StrikeTemp)+ 32)) + RecipeName = bf_recipe['name'] BoilTime = bf_recipe['boilTime'] mash_steps=bf_recipe['mash']['steps']