microsoft / IoT-For-Beginners

12 Weeks, 24 Lessons, IoT for All!
https://microsoft.github.io/IoT-For-Beginners/
MIT License
15.33k stars 2.4k forks source link

Missing explanation for implementation logic lesson 5 #357

Open pirnerjonas opened 2 years ago

pirnerjonas commented 2 years ago

In this section I created the file __init__.py. When I run the event trigger in this section it outputs the following

(.venv) ➜  soil-moisture-trigger func start
Found Python version 3.9.1 (python3).

Azure Functions Core Tools
Core Tools Version:       3.0.3442 Commit hash: 6bfab24b2743f8421475d996402c398d2fe4a9e0  (64-bit)
Function Runtime Version: 3.0.15417.0

Functions:

        iot-hub-trigger: eventHubTrigger

For detailed output, run func with --verbose flag.
[2021-05-05T02:44:07.517Z] Worker process started and initialized.
[2021-05-05T02:44:09.202Z] Executing 'Functions.iot-hub-trigger' (Reason='(null)', Id=802803a5-eae9-4401-a1f4-176631456ce4)
[2021-05-05T02:44:09.205Z] Trigger Details: PartionId: 0, Offset: 1011240-1011632, EnqueueTimeUtc: 2021-05-04T19:04:04.2030000Z-2021-05-04T19:04:04.3900000Z, SequenceNumber: 2546-2547, Count: 2
[2021-05-05T02:44:09.352Z] Python EventHub trigger processed an event: {"soil_moisture":628}
[2021-05-05T02:44:09.354Z] Python EventHub trigger processed an event: {"soil_moisture":624}
[2021-05-05T02:44:09.395Z] Executed 'Functions.iot-hub-trigger' (Succeeded, Id=802803a5-eae9-4401-a1f4-176631456ce4, Duration=245ms)

But I think up to that point we did not receive instructions that showed how to implement the code that outputs the soil moisture values stated there. Is the explanation to implement this logic in the file __init__.py missing or did I not find it?

pirnerjonas commented 2 years ago

I just found that in the next section the implementation of the logic is explained. Maybe it would be nice to add a disclaimer that soil moisture output logic will be handled in section below.