opensatx / sawaterlevel-api

Simple web scraper that grabs water data for sawaterlevel app, serves json
sawaterlevels-api.herokuapp.com
3 stars 2 forks source link

API Needs to support specifying that is an irrigation week during Stage 3 restrictions #7

Open waynehartman opened 10 years ago

waynehartman commented 10 years ago

Stage 3 restrictions only allow for irrigation every other week. Since the client cannot determine when restrictions started, the server will need to inform the client when it is permitted to irrigate their lawn during this stage level.

The SAWS stage restriction information states that the website will display when it is permitted for irrigation. Unfortunately, we are not in Stage 3 restrictions to know where to scrape it from. Nevertheless, we should add the field to the API now so that the client can look for it during that restriction period. We can update the server-side code if/when we enter stage 3 restrictions.

I propose an update to the return payload as follows:

{
    "level" : {
        "recent" : 633.0,
        "average" : 635.0,
        "lastUpdated" : "2014-07-12T20:00:00+00:00"
    },
    "stageLevel" : 2,
    "irrigationAllowed" : true
}
davidrleonard commented 10 years ago

Irrigation level is supported now, we'll have to add the real features in when we hit stageLevel 3 (see #12)