Jeelog - problème auto-actualisation

ca marche merci
je test en beta pour voir
mais mon script ne remonte que 2 caractères il ne peut pas y avoir de virgules …
je te met le script au cas ou …

import time
import os
import json
import requests
from requests.auth import HTTPDigestAuth
import pprint
import sys
# exemple de reponse a une commande pwr
'''
pwr
@
Power Volt   Curr   Tempr  Tlow   Thigh  Vlow   Vhigh  Base.St  Volt.St  Curr.St  Temp.St  Coulomb  Time                 B.V.St   B.T.St  
1     49390  0      21000  18000  18000  3291   3294   Idle     Normal   Normal   Normal   35%      2019-12-22 15:07:15  Normal   Normal  
2     49400  0      21000  18000  18000  3292   3294   Idle     Normal   Normal   Normal   33%      2019-12-22 15:07:14  Normal   Normal  
3     49404  0      21000  18000  18000  3292   3295   Idle     Normal   Normal   Normal   42%      2019-12-22 15:07:14  Normal   Normal  
4     49405  0      21000  18000  18000  3292   3295   Idle     Normal   Normal   Normal   43%      2019-12-22 15:07:14  Normal   Normal  
5     49398  0      20000  17000  17000  3292   3294   Idle     Normal   Normal   Normal   44%      2019-12-22 15:07:14  Normal   Normal  
6     49393  0      20000  17000  17000  3292   3294   Idle     Normal   Normal   Normal   39%      2019-12-22 15:07:14  Normal   Normal  
7     49393  0      20000  16000  17000  3292   3294   Idle     Normal   Normal   Normal   41%      2019-12-22 15:07:14  Normal   Normal  
8     49402  0      19000  15000  16000  3293   3295   Idle     Normal   Normal   Normal   44%      2019-12-22 15:07:14  Normal   Normal  
Command completed successfully
$$
pylon>
'''


def question_pylon(): # inerroge le BMS Pylontech avec une commande pwr
    resp = requests.get('http://192.168.0.199/req?code=pwr')
    if resp.status_code == requests.codes.ok:
       #print('ca marche')
       reponse = str(resp.text)
       #print ('reponse OK')
       
    else:
        #print('ca marche pas')
        reponse=''
        
    return reponse

# reherche de la plus petite valeur des % de charge des 8 bateries
def pcbt():
    rep = question_pylon()
    
    x = rep.find("%") # cherche le 1er %
    a=rep[x-4:x]      # prend la valeur sur 2 caracteres
    #print(a)
    
    b=a               # stock la valeur dans b
    
    x = rep.find("%",x+1) # cherche le % suivant 
    a=rep[x-2:x]          # prend la valeur sur 2 caracteres
    if a<b:               # si la valeur est plus petite
        b=a               # on la stock dans b
    
    x = rep.find("%",x+1) # on recommence jusqu'a 8 fois
    a=rep[x-2:x]
    if a<b:
        b=a
    
    x = rep.find("%",x+1)
    a=rep[x-2:x]
    if a<b:
        b=a

    x = rep.find("%",x+1)
    a=rep[x-2:x]
    if a<b:
        b=a

    x = rep.find("%",x+1)
    a=rep[x-2:x]
    if a<b:
        b=a
    
    x = rep.find("%",x+1)
    a=rep[x-2:x]
    if a<b:
        b=a
    
    x = rep.find("%",x+1)
    a=rep[x-2:x]
    if a<b:
        b=a

    return(b) # retourne la valeur la plus petite des % de charge des 8 bateries


print(pcbt())