Gepardec / Hogarama

Home and Garden Automation
GNU General Public License v3.0
16 stars 8 forks source link

Display watering of plants on homepage #178

Closed fhochleitner closed 5 years ago

fhochleitner commented 6 years ago

As as User I want to know when my plant my watered and how it affected its moisture level.

Acceptance Criteria

Ruhsi commented 6 years ago

The watering of the plants is now displayed on the homepage. Small waterdrops are displayed and the duration is shown in the label. This looks like the following: grafik

However, there are a few issues with this solution:

  1. I created a class WateringData, (like SensorData), which holds the specific watering data. maybe WateringData and SensorData should extend an abstract base class. So methods, like ... public List<SensorData> getAllData(Integer maxNumber, String sensorName, Date from, Date to) don't get copied for every data class, but are more generic.

  2. The MongoDbProducer lets you only work with one single collection ('habarama'). So SensorData- and WateringData-objects are all in the same collection in the mongoDB.

  3. With the sendActorMessage(String location, String actorName, Integer duration) I don't get the current moisture value. So in the frontend I use the previous value (last value before watering) and not the actual.

The code can be reviewed and tested on the branch: 178_Display_watering_of_plants_on_homepage