craftbeerpi3 icon indicating copy to clipboard operation
craftbeerpi3 copied to clipboard

Contributing back jpgimenez changes to cbpi3

Open jpgimenez opened this issue 4 years ago • 8 comments

master branch includes the following changes:

  • check_hop_timer skip empty values https://github.com/Manuel83/craftbeerpi3/pull/236
  • PWM improvements https://github.com/Manuel83/craftbeerpi3/pull/237
  • migrate to python 3 https://github.com/Manuel83/craftbeerpi3/pull/257
  • add support for ssl https://github.com/Manuel83/craftbeerpi3/pull/249 (https://github.com/mstrinzha)
  • migrate to Flask 1.1 and python 3.8 https://github.com/Manuel83/craftbeerpi3/pull/259
  • Improve dummy sensor #260

If you want to use this changes on your cbpi installation, download the patch https://patch-diff.githubusercontent.com/raw/Manuel83/craftbeerpi3/pull/258.patch and apply it.

jpgimenez avatar Aug 02 '20 14:08 jpgimenez

Graphs are not diplayed with python 3. --> modules/log/endpoints.py requires change in line 59: ''' import csv

    array = []

    with open(filename, 'rt', encoding='utf-8') as f:

        reader = csv.reader(f)

'''

avollkopf avatar Aug 07 '20 14:08 avollkopf

charts fixed df8c6a7

Graphs are not diplayed with python 3. --> modules/log/endpoints.py requires change in line 59: ''' import csv

    array = []

    with open(filename, 'rt', encoding='utf-8') as f:

        reader = csv.reader(f)

'''

jpgimenez avatar Aug 08 '20 22:08 jpgimenez

I have added some code to display only one point per minute. Now loads ok a 5 days fermentation graph.

import csv
        array = []
        with open(filename, 'rb') as f:
            reader = csv.reader(f)
            l_time=0
            for row in reader:
                try:
                    p_time=int((datetime.datetime.strptime(row[0], "%Y-%m-%d %H:%M:%S") - datetime.datetime(1970, 1, 1)).total_seconds()) * 1000
                    if ( abs(float(row[1])) < 100 ) and ( p_time >= l_time ):
                        l_time = p_time + 60000;
                        array.append([p_time , float(row[1])])
                except:
                    pass
        return array

Also on lines 80 and 121 of Modules/core/controler.py added tank name in the bottom of the graph.

 80         result.append({"name": kettle.name+" Temp", "data_type": "sensor", "data_id": kettle.sensor})

121              result.append({"name": fermenter.name+" Temp", "data_type": "sensor", "data_id": fermenter.senso
r})

lalo-uy avatar Aug 09 '20 11:08 lalo-uy

fermenter.py causes an error: File "/home/pi/craftbeerpi3/modules/fermenter/init.py", line 187, in start_fermentation inactive.direction = "C" if current_temp >= inactive.temp else "H" TypeError: '>=' not supported between instances of 'float' and 'str'

-> fix: inactive.direction = "C" if float(current_temp) >= float(inactive.temp) else "H"

avollkopf avatar Aug 09 '20 14:08 avollkopf

fermenter.py causes an error: File "/home/pi/craftbeerpi3/modules/fermenter/init.py", line 187, in start_fermentation inactive.direction = "C" if current_temp >= inactive.temp else "H" TypeError: '>=' not supported between instances of 'float' and 'str'

-> fix: inactive.direction = "C" if float(current_temp) >= float(inactive.temp) else "H"

I use cbpi only to brew, I ferment with brewpiless, but I'll try to fix this...

jpgimenez avatar Aug 09 '20 19:08 jpgimenez

I have added some code to display only one point per minute. Now loads ok a 5 days fermentation graph.

import csv
        array = []
        with open(filename, 'rb') as f:
            reader = csv.reader(f)
            l_time=0
            for row in reader:
                try:
                    p_time=int((datetime.datetime.strptime(row[0], "%Y-%m-%d %H:%M:%S") - datetime.datetime(1970, 1, 1)).total_seconds()) * 1000
                    if ( abs(float(row[1])) < 100 ) and ( p_time >= l_time ):
                        l_time = p_time + 60000;
                        array.append([p_time , float(row[1])])
                except:
                    pass
        return array

Also on lines 80 and 121 of Modules/core/controler.py added tank name in the bottom of the graph.

 80         result.append({"name": kettle.name+" Temp", "data_type": "sensor", "data_id": kettle.sensor})

121              result.append({"name": fermenter.name+" Temp", "data_type": "sensor", "data_id": fermenter.senso
r})

could you create a PR against my branch? or maybe send me a patch...

jpgimenez avatar Aug 09 '20 19:08 jpgimenez

I use cbpi only to brew, I ferment with brewpiless, but I'll try to fix this...

ok, i changed the code yesterday to the line i posted and the error was gone

avollkopf avatar Aug 10 '20 05:08 avollkopf

Will investigate haw to create a PR.

El El dom, 9 de ago. de 2020 a la(s) 16:11, Juan Pablo Giménez < [email protected]> escribió:

I have added some code to display only one point per minute. Now loads ok a 5 days fermentation graph.

import csv array = [] with open(filename, 'rb') as f: reader = csv.reader(f) l_time=0 for row in reader: try: p_time=int((datetime.datetime.strptime(row[0], "%Y-%m-%d %H:%M:%S") - datetime.datetime(1970, 1, 1)).total_seconds()) * 1000 if ( abs(float(row[1])) < 100 ) and ( p_time >= l_time ): l_time = p_time + 60000; array.append([p_time , float(row[1])]) except: pass return array

Also on lines 80 and 121 of Modules/core/controler.py added tank name in the bottom of the graph.

80 result.append({"name": kettle.name+" Temp", "data_type": "sensor", "data_id": kettle.sensor})

121 result.append({"name": fermenter.name+" Temp", "data_type": "sensor", "data_id": fermenter.senso r})

could you create a PR against my branch? or maybe send me a patch...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/Manuel83/craftbeerpi3/pull/258#issuecomment-671089850, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACXBW4N7WDC5DOBFQVOSR5TR73YGBANCNFSM4PSSLBBQ .

lalo-uy avatar Aug 10 '20 15:08 lalo-uy