1
00:00:09,520 --> 00:00:16,730
So the next event listener that we want to handle is called The Discharge in Time Change.

2
00:00:16,750 --> 00:00:20,950
So let's create a function here as update.

3
00:00:21,870 --> 00:00:29,230
Discharging time info is very long, but that's okay.

4
00:00:29,470 --> 00:00:39,130
And for this let's console.log the discharge in time info and that is the battery dock's discharge in

5
00:00:39,130 --> 00:00:39,760
time

6
00:00:42,790 --> 00:00:50,830
and let's call the function inside the discharge in time change handler and here we go update discharge

7
00:00:50,830 --> 00:00:58,750
and time info and let's call the same function inside our global function here and let's save it and

8
00:00:58,750 --> 00:00:59,470
let's have a look.

9
00:00:59,470 --> 00:01:01,960
We can see that it is infinity.

10
00:01:02,170 --> 00:01:09,760
So next step is that let's inject into the DOM and the elements is this one that is the battery discharge

11
00:01:09,760 --> 00:01:10,570
in time.

12
00:01:10,570 --> 00:01:15,370
And we have selected it here as battery discharge in time.

13
00:01:15,370 --> 00:01:21,010
So let's get to the event listener and that is this one.

14
00:01:21,220 --> 00:01:31,570
So now we can call the elements dot in HTML and we are going to inject the value is equal to that and

15
00:01:31,570 --> 00:01:34,450
let's remove the console log, let's save it.

16
00:01:34,450 --> 00:01:38,050
And now you can see that it is in the DOM or better.

17
00:01:38,070 --> 00:01:45,640
So we can add the scans to it as scans and let's have some space as that.

18
00:01:45,640 --> 00:01:48,550
And now you can see that infinity scans.

19
00:01:48,700 --> 00:01:52,060
So what about the charging time change?

20
00:01:52,060 --> 00:01:54,790
So let's handle that one also.

21
00:01:54,950 --> 00:02:11,290
So down here, let's create the function as update charging time change info is very long, but that's

22
00:02:11,360 --> 00:02:11,950
okay.

23
00:02:12,280 --> 00:02:22,750
So here we are going to console.log the charging time info as battery dot charging time.

24
00:02:25,780 --> 00:02:31,360
So let's call the function here as update charging info.

25
00:02:32,020 --> 00:02:38,200
And lastly, let's call it above here as an update charging info.

26
00:02:38,200 --> 00:02:41,860
And now let's check our console and we have zero.

27
00:02:42,280 --> 00:02:49,390
So let's inject this value into the DOM and this is what we want called battery charging time.

28
00:02:49,390 --> 00:02:52,720
So it's going to be as battery.

29
00:02:54,090 --> 00:03:00,300
Charging time dot is not a TML is equal to the value.

30
00:03:00,420 --> 00:03:02,160
Let's see what you're going to get.

31
00:03:02,160 --> 00:03:03,400
And we have zero.

32
00:03:03,420 --> 00:03:07,050
So lastly, let's add the seconds to it.

33
00:03:09,150 --> 00:03:09,860
Oh, great.

34
00:03:09,870 --> 00:03:10,600
No space.

35
00:03:10,620 --> 00:03:12,090
Let's add some space.

36
00:03:12,720 --> 00:03:14,160
And that is it.

37
00:03:14,190 --> 00:03:16,560
Charging time is 0 seconds.

38
00:03:16,590 --> 00:03:17,180
Great.

39
00:03:17,190 --> 00:03:24,660
And for the last one, if you want to implement, let's say that if the battery level is 100%, you

40
00:03:24,660 --> 00:03:28,720
can say it is fully charged or it is below 50%.

41
00:03:28,740 --> 00:03:35,940
We can say a low battery and we can give yourself a challenge by implementing this logic.

42
00:03:35,970 --> 00:03:39,450
The next video Let's work on the low cost storage.

43
00:03:39,450 --> 00:03:43,800
How we can create a project using the low cost storage.

