Cell phone battery autonomy statistics in python

3

I have this data of the battery use of my cell phone that I captured using Tasker:

97 - 1467514184514
tela desligada - 1467514366535
tela ligada - 1467514369196
96 - 1467514414616
95 - 1467514674523
94 - 1467514924621
93 - 1467515154585
92 - 1467515364555
91 - 1467515644567
90 - 1467515904577
89 - 1467516164576
88 - 1467516444576
87 - 1467516724599
86 - 1467516974598
85 - 1467517234639
84 - 1467517524627
83 - 1467517774639
tela desligada - 1467517831625
tela ligada - 1467517844633
82 - 1467518044654
81 - 1467518304726
80 - 1467518564731
79 - 1467518854649
tela desligada - 1467519062759
tela ligada - 1467519065287
78 - 1467519114701
tela desligada - 1467519222448
tela ligada - 1467519224361
tela desligada - 1467519268223
tela ligada - 1467519270241
tela desligada - 1467519313549
tela ligada - 1467519315661
77 - 1467519394673
tela ligada - 1467519525076
77 - 1467519534643
76 - 1467519625736
75 - 1467519874688
74 - 1467520114710
tela desligada - 1467520268384
tela ligada - 1467520277494
73 - 1467520364777
tela desligada - 1467520374973
tela ligada - 1467520375570
tela desligada - 1467520510265
tela ligada - 1467520512333
tela desligada - 1467520535432
tela ligada - 1467520536223
tela desligada - 1467520626069
tela ligada - 1467520628278
72 - 1467520644742
tela ligada - 1467520726202
tela desligada - 1467520728528
72 - 1467520742118
tela ligada - 1467520742157
carregando bateria - 1467520742203
tela desligada - 1467520743675
73 - 1467520841112
tela ligada - 1467520848617
tela desligada - 1467520864967
74 - 1467520931093
75 - 1467521011773
76 - 1467521091225
77 - 1467521171491
78 - 1467521241273
79 - 1467521311313
80 - 1467521381433
81 - 1467521451291
82 - 1467521521127
83 - 1467521591250
84 - 1467521661254
85 - 1467521731324
86 - 1467521801328
87 - 1467521871262
88 - 1467521941243
89 - 1467522021200
90 - 1467522101530
91 - 1467522191145
92 - 1467522291331
93 - 1467522401305
94 - 1467522521292
95 - 1467522661469
96 - 1467522821464
97 - 1467523021208
98 - 1467523261325
99 - 1467523561392
100 - 1467524071444
tela ligada - 1467543507927
tela desligada - 1467543522847
tela ligada - 1467543553598
tela desligada - 1467543555464
desarregando bateria - 1467543570366
tela ligada - 1467543570466
tela desligada - 1467543572805
tela ligada - 1467543573367
tela ligada - 1467543762197
100 - 1467543769538
tela desligada - 1467543799334
tela ligada - 1467543801542
tela desligada - 1467543824793
tela ligada - 1467543834876
99 - 1467543933770
tela ligada - 1467543996645
99 - 1467544003623
tela ligada - 1467544153861
98 - 1467544163912
97 - 1467544323634
tela desligada - 1467544325142
tela ligada - 1467544329638
tela desligada - 1467544386685
tela ligada - 1467544483093
tela desligada - 1467544571038
96 - 1467544609004
tela ligada - 1467544609039
tela ligada - 1467544745366
96 - 1467544748377
95 - 1467544798445
94 - 1467545068409
93 - 1467545308429
92 - 1467545558429
tela ligada - 1467545595320
tela desligada - 1467545597590
92 - 1467545598382
tela ligada - 1467545696894
tela desligada - 1467545757555
tela ligada - 1467545933920
91 - 1467546013522
tela desligada - 1467546113335
tela ligada - 1467546140287
90 - 1467546318244
tela ligada - 1467546377997
90 - 1467546378382
tela desligada - 1467546409534
tela ligada - 1467546451043
89 - 1467546630530
tela desligada - 1467546663460
tela ligada - 1467546814986
tela desligada - 1467546825432
88 - 1467547523083
tela ligada - 1467550033900
tela desligada - 1467550061241
tela ligada - 1467550063275
tela ligada - 1467550132143
88 - 1467550133363
87 - 1467550233622
86 - 1467550503471
85 - 1467550843458
tela desligada - 1467550908878
tela ligada - 1467550927895
84 - 1467551207421
83 - 1467551557383
tela desligada - 1467551790452
tela ligada - 1467552405020
tela desligada - 1467552425594
tela ligada - 1467552865867
82 - 1467552875404
tela desligada - 1467552885894
tela desligada - 1467552888918
82 - 1467553007104
tela ligada - 1467554234966
81 - 1467554244423
tela ligada - 1467554326023
81 - 1467554344363
tela desligada - 1467554355202
80 - 1467554451089
tela ligada - 1467554463059
tela desligada - 1467554507173
tela desligada - 1467554510531
80 - 1467554512114
tela ligada - 1467554535934
79 - 1467554635456
tela ligada - 1467554689882
79 - 1467554695461
tela desligada - 1467554766183
tela ligada - 1467554768110
tela desligada - 1467554778616
tela ligada - 1467554803911
78 - 1467554853440
77 - 1467555083503
76 - 1467555383387
75 - 1467555623525
74 - 1467555873422
73 - 1467556113534
tela ligada - 1467556152852
73 - 1467556153400
tela ligada - 1467556184928
73 - 1467556193424
72 - 1467556323438
71 - 1467556583452
70 - 1467556823513
69 - 1467557103509
tela desligada - 1467557191455
tela ligada - 1467557490051
tela desligada - 1467557494232
tela ligada - 1467557858175
tela ligada - 1467557879460
tela desligada - 1467557879482
tela ligada - 1467557908318
68 - 1467557914380
tela desligada - 1467557925409
tela ligada - 1467558492101
tela desligada - 1467558510096
tela ligada - 1467558887050
tela desligada - 1467558921283
tela ligada - 1467559261338
67 - 1467559270523
66 - 1467559440485

My goal is to find out how long it takes to change the status of the battery with the display turned on, off, and whether or not the phone is charging. In python I made this script to get the data from the lol.txt file:

import glob, time, pprint

a = glob.glob('*.txt')[:1]

def postar_bonito(kk):
    l = []
    x = kk.splitlines()
    for k in x:
        m, o = k.split(' - ')
        o = time.strftime('%d/%m/%Y - %H:%M:%S', time.localtime(int(o)/1000))
        if m[0].isdigit(): m += '%'
        l.append('%s - %s' % (o, m))
    return '\n'.join(l)

def estava_ligado(x):
    m = f.index('tela desligada')
    mm = f.index('tela ligada')
    return mm > m

def remover_repetidos(s):
    last = 'lolcopter'
    k = []
    for i, e in enumerate(s):
        lolcopter = e.split(' - ')[0]
        if lolcopter != last:
            k.append(lolcopter)
        last = lolcopter
    return k

def estava_carregando(j):
    lol = remover_repetidos([m for m in j.splitlines() if m[0].isdigit()])
    return int(lol[0]) < int(lol[1])

def prettytime(x):
    return time.strftime('%d/%m/%Y - %H:%M:%S', time.localtime(int(x) / 1000))

def prettytime2(x):
    o, k = divmod(x, 60)
    return '%02d:%02d' % (o, k)

def process(x, y, z):
    return [z, prettytime(x), prettytime(y), prettytime2((int(y) - int(x)) / 1000)]

for i in a:
    f = file(i, 'r').read()
    carregando_tela_ligada = []
    carregando_tela_desligada = []
    descarregando_tela_ligada = []
    descarregando_tela_desligada = []
    carregando = estava_carregando(f)
    tela = estava_ligado(f)
    last = None
    last_percent = None
    for h in f.splitlines():
        g, r = h.split(' - ')

        if g[0].isdigit():
            if g != last_percent:
                if last == None:
                    last = r
                if carregando:
                    if tela:
                        carregando_tela_ligada.append(process(last, r, last_percent))
                    else:
                        carregando_tela_desligada.append(process(last, r, last_percent))
                else:
                    if tela:
                        descarregando_tela_ligada.append(process(last, r, last_percent))
                    else:
                        descarregando_tela_desligada.append(process(last, r, last_percent))
                last = r
                last_percent = g

        if g == "tela desligada":
            tela = False
        if g == "tela ligada":
            tela = True
        if g == "descarregando bateria":
            carregando = False
        if g == "carregando bateria":
            carregando = True

    print "carregando_tela_ligada ="
    pprint.pprint(carregando_tela_ligada)
    print "carregando_tela_desligada ="
    pprint.pprint(carregando_tela_desligada)
    print "descarregando_tela_ligada ="
    pprint.pprint(descarregando_tela_ligada)
    print "descarregando_tela_desligada ="
    pprint.pprint(descarregando_tela_desligada)

The output is this:

carregando_tela_ligada =
[['100', '03/07/2016 - 02:34:31', '03/07/2016 - 08:05:33', '331:02'],
 ['99', '03/07/2016 - 08:05:33', '03/07/2016 - 08:09:23', '03:50'],
 ['98', '03/07/2016 - 08:09:23', '03/07/2016 - 08:12:03', '02:39'],
 ['96', '03/07/2016 - 08:16:49', '03/07/2016 - 08:19:58', '03:09'],
 ['95', '03/07/2016 - 08:19:58', '03/07/2016 - 08:24:28', '04:29'],
 ['94', '03/07/2016 - 08:24:28', '03/07/2016 - 08:28:28', '04:00'],
 ['93', '03/07/2016 - 08:28:28', '03/07/2016 - 08:32:38', '04:10'],
 ['92', '03/07/2016 - 08:32:38', '03/07/2016 - 08:40:13', '07:35'],
 ['91', '03/07/2016 - 08:40:13', '03/07/2016 - 08:45:18', '05:04'],
 ['90', '03/07/2016 - 08:45:18', '03/07/2016 - 08:50:30', '05:12'],
 ['88', '03/07/2016 - 09:05:23', '03/07/2016 - 09:50:33', '45:10'],
 ['87', '03/07/2016 - 09:50:33', '03/07/2016 - 09:55:03', '04:29'],
 ['86', '03/07/2016 - 09:55:03', '03/07/2016 - 10:00:43', '05:39'],
 ['85', '03/07/2016 - 10:00:43', '03/07/2016 - 10:06:47', '06:03'],
 ['84', '03/07/2016 - 10:06:47', '03/07/2016 - 10:12:37', '05:49'],
 ['83', '03/07/2016 - 10:12:37', '03/07/2016 - 10:34:35', '21:58'],
 ['82', '03/07/2016 - 10:34:35', '03/07/2016 - 10:57:24', '22:49'],
 ['80', '03/07/2016 - 11:00:51', '03/07/2016 - 11:03:55', '03:04'],
 ['79', '03/07/2016 - 11:03:55', '03/07/2016 - 11:07:33', '03:37'],
 ['78', '03/07/2016 - 11:07:33', '03/07/2016 - 11:11:23', '03:50'],
 ['77', '03/07/2016 - 11:11:23', '03/07/2016 - 11:16:23', '04:59'],
 ['76', '03/07/2016 - 11:16:23', '03/07/2016 - 11:20:23', '04:00'],
 ['75', '03/07/2016 - 11:20:23', '03/07/2016 - 11:24:33', '04:09'],
 ['74', '03/07/2016 - 11:24:33', '03/07/2016 - 11:28:33', '04:00'],
 ['73', '03/07/2016 - 11:28:33', '03/07/2016 - 11:32:03', '03:29'],
 ['72', '03/07/2016 - 11:32:03', '03/07/2016 - 11:36:23', '04:20'],
 ['71', '03/07/2016 - 11:36:23', '03/07/2016 - 11:40:23', '04:00'],
 ['70', '03/07/2016 - 11:40:23', '03/07/2016 - 11:45:03', '04:39'],
 ['69', '03/07/2016 - 11:45:03', '03/07/2016 - 11:58:34', '13:30'],
 ['68', '03/07/2016 - 11:58:34', '03/07/2016 - 12:21:10', '22:36'],
 ['67', '03/07/2016 - 12:21:10', '03/07/2016 - 12:24:00', '02:49']]
carregando_tela_desligada =
[['72', '03/07/2016 - 01:37:24', '03/07/2016 - 01:40:41', '03:16'],
 ['73', '03/07/2016 - 01:40:41', '03/07/2016 - 01:42:11', '01:29'],
 ['74', '03/07/2016 - 01:42:11', '03/07/2016 - 01:43:31', '01:20'],
 ['75', '03/07/2016 - 01:43:31', '03/07/2016 - 01:44:51', '01:19'],
 ['76', '03/07/2016 - 01:44:51', '03/07/2016 - 01:46:11', '01:20'],
 ['77', '03/07/2016 - 01:46:11', '03/07/2016 - 01:47:21', '01:09'],
 ['78', '03/07/2016 - 01:47:21', '03/07/2016 - 01:48:31', '01:10'],
 ['79', '03/07/2016 - 01:48:31', '03/07/2016 - 01:49:41', '01:10'],
 ['80', '03/07/2016 - 01:49:41', '03/07/2016 - 01:50:51', '01:09'],
 ['81', '03/07/2016 - 01:50:51', '03/07/2016 - 01:52:01', '01:09'],
 ['82', '03/07/2016 - 01:52:01', '03/07/2016 - 01:53:11', '01:10'],
 ['83', '03/07/2016 - 01:53:11', '03/07/2016 - 01:54:21', '01:10'],
 ['84', '03/07/2016 - 01:54:21', '03/07/2016 - 01:55:31', '01:10'],
 ['85', '03/07/2016 - 01:55:31', '03/07/2016 - 01:56:41', '01:10'],
 ['86', '03/07/2016 - 01:56:41', '03/07/2016 - 01:57:51', '01:09'],
 ['87', '03/07/2016 - 01:57:51', '03/07/2016 - 01:59:01', '01:09'],
 ['88', '03/07/2016 - 01:59:01', '03/07/2016 - 02:00:21', '01:19'],
 ['89', '03/07/2016 - 02:00:21', '03/07/2016 - 02:01:41', '01:20'],
 ['90', '03/07/2016 - 02:01:41', '03/07/2016 - 02:03:11', '01:29'],
 ['91', '03/07/2016 - 02:03:11', '03/07/2016 - 02:04:51', '01:40'],
 ['92', '03/07/2016 - 02:04:51', '03/07/2016 - 02:06:41', '01:49'],
 ['93', '03/07/2016 - 02:06:41', '03/07/2016 - 02:08:41', '01:59'],
 ['94', '03/07/2016 - 02:08:41', '03/07/2016 - 02:11:01', '02:20'],
 ['95', '03/07/2016 - 02:11:01', '03/07/2016 - 02:13:41', '02:39'],
 ['96', '03/07/2016 - 02:13:41', '03/07/2016 - 02:17:01', '03:19'],
 ['97', '03/07/2016 - 02:17:01', '03/07/2016 - 02:21:01', '04:00'],
 ['98', '03/07/2016 - 02:21:01', '03/07/2016 - 02:26:01', '05:00'],
 ['99', '03/07/2016 - 02:26:01', '03/07/2016 - 02:34:31', '08:30'],
 ['97', '03/07/2016 - 08:12:03', '03/07/2016 - 08:16:49', '04:45'],
 ['89', '03/07/2016 - 08:50:30', '03/07/2016 - 09:05:23', '14:52'],
 ['81', '03/07/2016 - 10:57:24', '03/07/2016 - 11:00:51', '03:26']]
descarregando_tela_ligada =
[[None, '02/07/2016 - 23:49:44', '02/07/2016 - 23:49:44', '00:00'],
 ['97', '02/07/2016 - 23:49:44', '02/07/2016 - 23:53:34', '03:50'],
 ['96', '02/07/2016 - 23:53:34', '02/07/2016 - 23:57:54', '04:19'],
 ['95', '02/07/2016 - 23:57:54', '03/07/2016 - 00:02:04', '04:10'],
 ['94', '03/07/2016 - 00:02:04', '03/07/2016 - 00:05:54', '03:49'],
 ['93', '03/07/2016 - 00:05:54', '03/07/2016 - 00:09:24', '03:29'],
 ['92', '03/07/2016 - 00:09:24', '03/07/2016 - 00:14:04', '04:40'],
 ['91', '03/07/2016 - 00:14:04', '03/07/2016 - 00:18:24', '04:20'],
 ['90', '03/07/2016 - 00:18:24', '03/07/2016 - 00:22:44', '04:19'],
 ['89', '03/07/2016 - 00:22:44', '03/07/2016 - 00:27:24', '04:40'],
 ['88', '03/07/2016 - 00:27:24', '03/07/2016 - 00:32:04', '04:40'],
 ['87', '03/07/2016 - 00:32:04', '03/07/2016 - 00:36:14', '04:09'],
 ['86', '03/07/2016 - 00:36:14', '03/07/2016 - 00:40:34', '04:20'],
 ['85', '03/07/2016 - 00:40:34', '03/07/2016 - 00:45:24', '04:49'],
 ['84', '03/07/2016 - 00:45:24', '03/07/2016 - 00:49:34', '04:10'],
 ['83', '03/07/2016 - 00:49:34', '03/07/2016 - 00:54:04', '04:30'],
 ['82', '03/07/2016 - 00:54:04', '03/07/2016 - 00:58:24', '04:20'],
 ['81', '03/07/2016 - 00:58:24', '03/07/2016 - 01:02:44', '04:20'],
 ['80', '03/07/2016 - 01:02:44', '03/07/2016 - 01:07:34', '04:49'],
 ['79', '03/07/2016 - 01:07:34', '03/07/2016 - 01:11:54', '04:20'],
 ['78', '03/07/2016 - 01:11:54', '03/07/2016 - 01:16:34', '04:39'],
 ['77', '03/07/2016 - 01:16:34', '03/07/2016 - 01:20:25', '03:51'],
 ['76', '03/07/2016 - 01:20:25', '03/07/2016 - 01:24:34', '04:08'],
 ['75', '03/07/2016 - 01:24:34', '03/07/2016 - 01:28:34', '04:00'],
 ['74', '03/07/2016 - 01:28:34', '03/07/2016 - 01:32:44', '04:10'],
 ['73', '03/07/2016 - 01:32:44', '03/07/2016 - 01:37:24', '04:39']]
descarregando_tela_desligada =
[]

But the data is incorrect. When loading with the screen on the power is decreasing and on loading with the screen off is ok but then there is a 89 and a 81 from the beyond!

Where is the logic error in my script? Does anyone suggest a better way to do what I want?

    
asked by anonymous 03.07.2016 / 20:05

1 answer

2

I found the error. On the tasker I was typing Disarming instead of Discharging .

It took me a long time to get the error. Here is the diff with a debug I made, if anyone is interested in unfolding.

link

Here is the output that I generated to debug:

1 - Descarregando o celular com a tela ligada, 97 - 1467514184514
2 - Descarregando o celular com a tela ligada, 96 - 1467514414616
3 - Descarregando o celular com a tela ligada, 95 - 1467514674523
4 - Descarregando o celular com a tela ligada, 94 - 1467514924621
5 - Descarregando o celular com a tela ligada, 93 - 1467515154585
6 - Descarregando o celular com a tela ligada, 92 - 1467515364555
7 - Descarregando o celular com a tela ligada, 91 - 1467515644567
8 - Descarregando o celular com a tela ligada, 90 - 1467515904577
9 - Descarregando o celular com a tela ligada, 89 - 1467516164576
10 - Descarregando o celular com a tela ligada, 88 - 1467516444576
11 - Descarregando o celular com a tela ligada, 87 - 1467516724599
12 - Descarregando o celular com a tela ligada, 86 - 1467516974598
13 - Descarregando o celular com a tela ligada, 85 - 1467517234639
14 - Descarregando o celular com a tela ligada, 84 - 1467517524627
15 - Descarregando o celular com a tela ligada, 83 - 1467517774639
16 - Descarregando o celular com a tela ligada, 82 - 1467518044654
17 - Descarregando o celular com a tela ligada, 81 - 1467518304726
18 - Descarregando o celular com a tela ligada, 80 - 1467518564731
19 - Descarregando o celular com a tela ligada, 79 - 1467518854649
20 - Descarregando o celular com a tela ligada, 78 - 1467519114701
21 - Descarregando o celular com a tela ligada, 77 - 1467519394673
22 - Descarregando o celular com a tela ligada, 77 - 1467519534643
23 - Descarregando o celular com a tela ligada, 76 - 1467519625736
24 - Descarregando o celular com a tela ligada, 75 - 1467519874688
25 - Descarregando o celular com a tela ligada, 74 - 1467520114710
26 - Descarregando o celular com a tela ligada, 73 - 1467520364777
27 - Descarregando o celular com a tela ligada, 72 - 1467520644742
28 - Descarregando o celular com a tela desligada, 72 - 1467520742118
29 - Carregando o celular com a tela desligada, 73 - 1467520841112
30 - Carregando o celular com a tela desligada, 74 - 1467520931093
31 - Carregando o celular com a tela desligada, 75 - 1467521011773
32 - Carregando o celular com a tela desligada, 76 - 1467521091225
33 - Carregando o celular com a tela desligada, 77 - 1467521171491
34 - Carregando o celular com a tela desligada, 78 - 1467521241273
35 - Carregando o celular com a tela desligada, 79 - 1467521311313
36 - Carregando o celular com a tela desligada, 80 - 1467521381433
37 - Carregando o celular com a tela desligada, 81 - 1467521451291
38 - Carregando o celular com a tela desligada, 82 - 1467521521127
39 - Carregando o celular com a tela desligada, 83 - 1467521591250
40 - Carregando o celular com a tela desligada, 84 - 1467521661254
41 - Carregando o celular com a tela desligada, 85 - 1467521731324
42 - Carregando o celular com a tela desligada, 86 - 1467521801328
43 - Carregando o celular com a tela desligada, 87 - 1467521871262
44 - Carregando o celular com a tela desligada, 88 - 1467521941243
45 - Carregando o celular com a tela desligada, 89 - 1467522021200
46 - Carregando o celular com a tela desligada, 90 - 1467522101530
47 - Carregando o celular com a tela desligada, 91 - 1467522191145
48 - Carregando o celular com a tela desligada, 92 - 1467522291331
49 - Carregando o celular com a tela desligada, 93 - 1467522401305
50 - Carregando o celular com a tela desligada, 94 - 1467522521292
51 - Carregando o celular com a tela desligada, 95 - 1467522661469
52 - Carregando o celular com a tela desligada, 96 - 1467522821464
53 - Carregando o celular com a tela desligada, 97 - 1467523021208
54 - Carregando o celular com a tela desligada, 98 - 1467523261325
55 - Carregando o celular com a tela desligada, 99 - 1467523561392
56 - Carregando o celular com a tela desligada, 100 - 1467524071444
57 - Descarregando o celular com a tela ligada, 100 - 1467543769538
58 - Descarregando o celular com a tela ligada, 99 - 1467543933770
59 - Descarregando o celular com a tela ligada, 99 - 1467544003623
60 - Descarregando o celular com a tela ligada, 98 - 1467544163912
61 - Descarregando o celular com a tela ligada, 97 - 1467544323634
62 - Descarregando o celular com a tela desligada, 96 - 1467544609004
63 - Descarregando o celular com a tela ligada, 96 - 1467544748377
64 - Descarregando o celular com a tela ligada, 95 - 1467544798445
65 - Descarregando o celular com a tela ligada, 94 - 1467545068409
66 - Descarregando o celular com a tela ligada, 93 - 1467545308429
67 - Descarregando o celular com a tela ligada, 92 - 1467545558429
68 - Descarregando o celular com a tela desligada, 92 - 1467545598382
69 - Descarregando o celular com a tela ligada, 91 - 1467546013522
70 - Descarregando o celular com a tela ligada, 90 - 1467546318244
71 - Descarregando o celular com a tela ligada, 90 - 1467546378382
72 - Descarregando o celular com a tela ligada, 89 - 1467546630530
73 - Descarregando o celular com a tela desligada, 88 - 1467547523083
74 - Descarregando o celular com a tela ligada, 88 - 1467550133363
75 - Descarregando o celular com a tela ligada, 87 - 1467550233622
76 - Descarregando o celular com a tela ligada, 86 - 1467550503471
77 - Descarregando o celular com a tela ligada, 85 - 1467550843458
78 - Descarregando o celular com a tela ligada, 84 - 1467551207421
79 - Descarregando o celular com a tela ligada, 83 - 1467551557383
80 - Descarregando o celular com a tela ligada, 82 - 1467552875404
81 - Descarregando o celular com a tela desligada, 82 - 1467553007104
82 - Descarregando o celular com a tela ligada, 81 - 1467554244423
83 - Descarregando o celular com a tela ligada, 81 - 1467554344363
84 - Descarregando o celular com a tela desligada, 80 - 1467554451089
85 - Descarregando o celular com a tela desligada, 80 - 1467554512114
86 - Descarregando o celular com a tela ligada, 79 - 1467554635456
87 - Descarregando o celular com a tela ligada, 79 - 1467554695461
88 - Descarregando o celular com a tela ligada, 78 - 1467554853440
89 - Descarregando o celular com a tela ligada, 77 - 1467555083503
90 - Descarregando o celular com a tela ligada, 76 - 1467555383387
91 - Descarregando o celular com a tela ligada, 75 - 1467555623525
92 - Descarregando o celular com a tela ligada, 74 - 1467555873422
93 - Descarregando o celular com a tela ligada, 73 - 1467556113534
94 - Descarregando o celular com a tela ligada, 73 - 1467556153400
95 - Descarregando o celular com a tela ligada, 73 - 1467556193424
96 - Descarregando o celular com a tela ligada, 72 - 1467556323438
97 - Descarregando o celular com a tela ligada, 71 - 1467556583452
98 - Descarregando o celular com a tela ligada, 70 - 1467556823513
99 - Descarregando o celular com a tela ligada, 69 - 1467557103509
100 - Descarregando o celular com a tela ligada, 68 - 1467557914380
101 - Descarregando o celular com a tela ligada, 67 - 1467559270523
102 - Descarregando o celular com a tela ligada, 66 - 1467559440485
===========================================================
carregando_tela_ligada =
[]
carregando_tela_desligada =
[[29, '73', '03/07/2016 - 01:39:02', '03/07/2016 - 01:40:41', '01:38'],
 [30, '74', '03/07/2016 - 01:40:41', '03/07/2016 - 01:42:11', '01:29'],
 [31, '75', '03/07/2016 - 01:42:11', '03/07/2016 - 01:43:31', '01:20'],
 [32, '76', '03/07/2016 - 01:43:31', '03/07/2016 - 01:44:51', '01:19'],
 [33, '77', '03/07/2016 - 01:44:51', '03/07/2016 - 01:46:11', '01:20'],
 [34, '78', '03/07/2016 - 01:46:11', '03/07/2016 - 01:47:21', '01:09'],
 [35, '79', '03/07/2016 - 01:47:21', '03/07/2016 - 01:48:31', '01:10'],
 [36, '80', '03/07/2016 - 01:48:31', '03/07/2016 - 01:49:41', '01:10'],
 [37, '81', '03/07/2016 - 01:49:41', '03/07/2016 - 01:50:51', '01:09'],
 [38, '82', '03/07/2016 - 01:50:51', '03/07/2016 - 01:52:01', '01:09'],
 [39, '83', '03/07/2016 - 01:52:01', '03/07/2016 - 01:53:11', '01:10'],
 [40, '84', '03/07/2016 - 01:53:11', '03/07/2016 - 01:54:21', '01:10'],
 [41, '85', '03/07/2016 - 01:54:21', '03/07/2016 - 01:55:31', '01:10'],
 [42, '86', '03/07/2016 - 01:55:31', '03/07/2016 - 01:56:41', '01:10'],
 [43, '87', '03/07/2016 - 01:56:41', '03/07/2016 - 01:57:51', '01:09'],
 [44, '88', '03/07/2016 - 01:57:51', '03/07/2016 - 01:59:01', '01:09'],
 [45, '89', '03/07/2016 - 01:59:01', '03/07/2016 - 02:00:21', '01:19'],
 [46, '90', '03/07/2016 - 02:00:21', '03/07/2016 - 02:01:41', '01:20'],
 [47, '91', '03/07/2016 - 02:01:41', '03/07/2016 - 02:03:11', '01:29'],
 [48, '92', '03/07/2016 - 02:03:11', '03/07/2016 - 02:04:51', '01:40'],
 [49, '93', '03/07/2016 - 02:04:51', '03/07/2016 - 02:06:41', '01:49'],
 [50, '94', '03/07/2016 - 02:06:41', '03/07/2016 - 02:08:41', '01:59'],
 [51, '95', '03/07/2016 - 02:08:41', '03/07/2016 - 02:11:01', '02:20'],
 [52, '96', '03/07/2016 - 02:11:01', '03/07/2016 - 02:13:41', '02:39'],
 [53, '97', '03/07/2016 - 02:13:41', '03/07/2016 - 02:17:01', '03:19'],
 [54, '98', '03/07/2016 - 02:17:01', '03/07/2016 - 02:21:01', '04:00'],
 [55, '99', '03/07/2016 - 02:21:01', '03/07/2016 - 02:26:01', '05:00'],
 [56, '100', '03/07/2016 - 02:26:01', '03/07/2016 - 02:34:31', '08:30']]
descarregando_tela_ligada =
[[1, '97', '02/07/2016 - 23:49:44', '02/07/2016 - 23:49:44', '00:00'],
 [2, '96', '02/07/2016 - 23:49:44', '02/07/2016 - 23:53:34', '03:50'],
 [3, '95', '02/07/2016 - 23:53:34', '02/07/2016 - 23:57:54', '04:19'],
 [4, '94', '02/07/2016 - 23:57:54', '03/07/2016 - 00:02:04', '04:10'],
 [5, '93', '03/07/2016 - 00:02:04', '03/07/2016 - 00:05:54', '03:49'],
 [6, '92', '03/07/2016 - 00:05:54', '03/07/2016 - 00:09:24', '03:29'],
 [7, '91', '03/07/2016 - 00:09:24', '03/07/2016 - 00:14:04', '04:40'],
 [8, '90', '03/07/2016 - 00:14:04', '03/07/2016 - 00:18:24', '04:20'],
 [9, '89', '03/07/2016 - 00:18:24', '03/07/2016 - 00:22:44', '04:19'],
 [10, '88', '03/07/2016 - 00:22:44', '03/07/2016 - 00:27:24', '04:40'],
 [11, '87', '03/07/2016 - 00:27:24', '03/07/2016 - 00:32:04', '04:40'],
 [12, '86', '03/07/2016 - 00:32:04', '03/07/2016 - 00:36:14', '04:09'],
 [13, '85', '03/07/2016 - 00:36:14', '03/07/2016 - 00:40:34', '04:20'],
 [14, '84', '03/07/2016 - 00:40:34', '03/07/2016 - 00:45:24', '04:49'],
 [15, '83', '03/07/2016 - 00:45:24', '03/07/2016 - 00:49:34', '04:10'],
 [16, '82', '03/07/2016 - 00:49:34', '03/07/2016 - 00:54:04', '04:30'],
 [17, '81', '03/07/2016 - 00:54:04', '03/07/2016 - 00:58:24', '04:20'],
 [18, '80', '03/07/2016 - 00:58:24', '03/07/2016 - 01:02:44', '04:20'],
 [19, '79', '03/07/2016 - 01:02:44', '03/07/2016 - 01:07:34', '04:49'],
 [20, '78', '03/07/2016 - 01:07:34', '03/07/2016 - 01:11:54', '04:20'],
 [21, '77', '03/07/2016 - 01:11:54', '03/07/2016 - 01:16:34', '04:39'],
 [22, '77', '03/07/2016 - 01:16:34', '03/07/2016 - 01:18:54', '02:19'],
 [23, '76', '03/07/2016 - 01:18:54', '03/07/2016 - 01:20:25', '01:31'],
 [24, '75', '03/07/2016 - 01:20:25', '03/07/2016 - 01:24:34', '04:08'],
 [25, '74', '03/07/2016 - 01:24:34', '03/07/2016 - 01:28:34', '04:00'],
 [26, '73', '03/07/2016 - 01:28:34', '03/07/2016 - 01:32:44', '04:10'],
 [27, '72', '03/07/2016 - 01:32:44', '03/07/2016 - 01:37:24', '04:39'],
 [57, '100', '03/07/2016 - 02:34:31', '03/07/2016 - 08:02:49', '328:18'],
 [58, '99', '03/07/2016 - 08:02:49', '03/07/2016 - 08:05:33', '02:44'],
 [59, '99', '03/07/2016 - 08:05:33', '03/07/2016 - 08:06:43', '01:09'],
 [60, '98', '03/07/2016 - 08:06:43', '03/07/2016 - 08:09:23', '02:40'],
 [61, '97', '03/07/2016 - 08:09:23', '03/07/2016 - 08:12:03', '02:39'],
 [63, '96', '03/07/2016 - 08:16:49', '03/07/2016 - 08:19:08', '02:19'],
 [64, '95', '03/07/2016 - 08:19:08', '03/07/2016 - 08:19:58', '00:50'],
 [65, '94', '03/07/2016 - 08:19:58', '03/07/2016 - 08:24:28', '04:29'],
 [66, '93', '03/07/2016 - 08:24:28', '03/07/2016 - 08:28:28', '04:00'],
 [67, '92', '03/07/2016 - 08:28:28', '03/07/2016 - 08:32:38', '04:10'],
 [69, '91', '03/07/2016 - 08:33:18', '03/07/2016 - 08:40:13', '06:55'],
 [70, '90', '03/07/2016 - 08:40:13', '03/07/2016 - 08:45:18', '05:04'],
 [71, '90', '03/07/2016 - 08:45:18', '03/07/2016 - 08:46:18', '01:00'],
 [72, '89', '03/07/2016 - 08:46:18', '03/07/2016 - 08:50:30', '04:12'],
 [74, '88', '03/07/2016 - 09:05:23', '03/07/2016 - 09:48:53', '43:30'],
 [75, '87', '03/07/2016 - 09:48:53', '03/07/2016 - 09:50:33', '01:40'],
 [76, '86', '03/07/2016 - 09:50:33', '03/07/2016 - 09:55:03', '04:29'],
 [77, '85', '03/07/2016 - 09:55:03', '03/07/2016 - 10:00:43', '05:39'],
 [78, '84', '03/07/2016 - 10:00:43', '03/07/2016 - 10:06:47', '06:03'],
 [79, '83', '03/07/2016 - 10:06:47', '03/07/2016 - 10:12:37', '05:49'],
 [80, '82', '03/07/2016 - 10:12:37', '03/07/2016 - 10:34:35', '21:58'],
 [82, '81', '03/07/2016 - 10:36:47', '03/07/2016 - 10:57:24', '20:37'],
 [83, '81', '03/07/2016 - 10:57:24', '03/07/2016 - 10:59:04', '01:39'],
 [86, '79', '03/07/2016 - 11:01:52', '03/07/2016 - 11:03:55', '02:03'],
 [87, '79', '03/07/2016 - 11:03:55', '03/07/2016 - 11:04:55', '01:00'],
 [88, '78', '03/07/2016 - 11:04:55', '03/07/2016 - 11:07:33', '02:37'],
 [89, '77', '03/07/2016 - 11:07:33', '03/07/2016 - 11:11:23', '03:50'],
 [90, '76', '03/07/2016 - 11:11:23', '03/07/2016 - 11:16:23', '04:59'],
 [91, '75', '03/07/2016 - 11:16:23', '03/07/2016 - 11:20:23', '04:00'],
 [92, '74', '03/07/2016 - 11:20:23', '03/07/2016 - 11:24:33', '04:09'],
 [93, '73', '03/07/2016 - 11:24:33', '03/07/2016 - 11:28:33', '04:00'],
 [94, '73', '03/07/2016 - 11:28:33', '03/07/2016 - 11:29:13', '00:39'],
 [95, '73', '03/07/2016 - 11:29:13', '03/07/2016 - 11:29:53', '00:40'],
 [96, '72', '03/07/2016 - 11:29:53', '03/07/2016 - 11:32:03', '02:10'],
 [97, '71', '03/07/2016 - 11:32:03', '03/07/2016 - 11:36:23', '04:20'],
 [98, '70', '03/07/2016 - 11:36:23', '03/07/2016 - 11:40:23', '04:00'],
 [99, '69', '03/07/2016 - 11:40:23', '03/07/2016 - 11:45:03', '04:39'],
 [100, '68', '03/07/2016 - 11:45:03', '03/07/2016 - 11:58:34', '13:30'],
 [101, '67', '03/07/2016 - 11:58:34', '03/07/2016 - 12:21:10', '22:36'],
 [102, '66', '03/07/2016 - 12:21:10', '03/07/2016 - 12:24:00', '02:49']]
descarregando_tela_desligada =
[[28, '72', '03/07/2016 - 01:37:24', '03/07/2016 - 01:39:02', '01:37'],
 [62, '96', '03/07/2016 - 08:12:03', '03/07/2016 - 08:16:49', '04:45'],
 [68, '92', '03/07/2016 - 08:32:38', '03/07/2016 - 08:33:18', '00:39'],
 [73, '88', '03/07/2016 - 08:50:30', '03/07/2016 - 09:05:23', '14:52'],
 [81, '82', '03/07/2016 - 10:34:35', '03/07/2016 - 10:36:47', '02:11'],
 [84, '80', '03/07/2016 - 10:59:04', '03/07/2016 - 11:00:51', '01:46'],
 [85, '80', '03/07/2016 - 11:00:51', '03/07/2016 - 11:01:52', '01:01']]
    
04.07.2016 / 00:08