GitXplorerGitXplorer
d

wateringtime

public
3 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
93ca89e0a95e2b41c05c1f858739f10188e5bd40

start py3 port; refactor program object creation

ddhellmann committed 8 years ago
Unverified
3d8886aad667257cc87d846abb4f8e467fd09ac9

expand readme

ddhellmann committed 8 years ago
Unverified
fc5ba032db14d8b77b5e672e98609a067ff2d26a

add program duration to outputs

ddhellmann committed 8 years ago
Unverified
9ada5844e6c7af4697e34585b32b7ac8f97830d9

fix tuesday/thursday detection

ddhellmann committed 8 years ago
Unverified
8b6627c2dcfdc12e416a03486619391b1c343feb

show zone names inline in simple view

ddhellmann committed 8 years ago
Unverified
c3ea33e7093c17f7c8775684cf3945dc3bbbf8b0

add a sample input file

ddhellmann committed 9 years ago

README

The README file for this repository.

=============== Watering Time

This package converts a representation of the watering schedule for my sprinkler control system to a calendar view that is easier to understand and validate.

Sprinkler System Model

The operating model for the program is based on a sprinkler system that can be programmed to send water to different sets of sprinkler heads grouped into zones. Each zone can be activated for a number of minutes, and a set of zone activations can be grouped into a program which is given a start time and specified days of the week when it runs. The model assumes that only run one zone at a time, so if the schedule introduces overlaps or conflicts the activations are serialized to run one after the other.

Input File

The data input file is a YAML file listing the watering zones and the watering programs.

Each zone is identified by a number, mapped to a short but descriptive name.

::

zones: 1: turf 2: f shrubs 3: b shrubs 4: patio 5: garden

The watering programs are identified by letters or short strings, and include a list of start times, a set of days of the week on which the program runs, and run times for each zone in the order that the zone is activated.

::

programs: A: start: - '3:30' days: TuThSaSu zones: - zone: 1 time: 30 - zone: 3 time: 30 - zone: 4 time: 10

Days are described using a string containing M, Tu, W, Th, F, Sa, and Su or odd or even.

::

programs: C: start: - '6:00' days: even zones: - zone: 5 time: 15

Usage

The wateringtime command line program produces output in two formats. The simple formatter summarizes the YAML data in a table.

::

$ wateringtime --format simple wateringtime.yaml +---------+----------+-------------+----------------+----------+ | Program | Days | Start Times | Zones | Duration | +---------+----------+-------------+----------------+----------+ | A | TuThSaSu | 03:30:00 | turf (30) | 70 | | | | 04:00:00 | b shrubs (30) | | | | | 04:30:00 | patio (10) | | | B | TuThSaSu | 05:00:00 | f shrubs (50) | 50 | | C | MWFSu | 06:00:00 | garden (15) | 15 | +---------+----------+-------------+----------------+----------+

The caledar formatter shows the watering schedule for each program and zone on each day of a specified month.

::

$ wateringtime -v --format calendar --year 2016 --month 9 wateringtime.yaml

                                                                              September                                                                                 

+----------------------+------------------------+----------------------+------------------------+----------------------+------------------------+------------------------+ | Mon | Tue | Wed | Thu | Fri | Sat | Sun | +----------------------+------------------------+----------------------+------------------------+----------------------+------------------------+------------------------+ | | | | (1) | (2) | (3) | (4) | | | | | | | | | | | | | A (TuThSaSu) [70] | C (MWFSu) [15] | A (TuThSaSu) [70] | A (TuThSaSu) [70] | | | | | 03:30-04:00 - turf | 06:00-06:15 - garden | 03:30-04:00 - turf | 03:30-04:00 - turf | | | | | 04:00-04:30 - b shrubs | | 04:00-04:30 - b shrubs | 04:00-04:30 - b shrubs | | | | | 04:30-04:40 - patio | | 04:30-04:40 - patio | 04:30-04:40 - patio | | | | | | | | | | | | | B (TuThSaSu) [50] | | B (TuThSaSu) [50] | B (TuThSaSu) [50] | | | | | 05:00-05:50 - f shrubs | | 05:00-05:50 - f shrubs | 05:00-05:50 - f shrubs | | | | | | | | | | | | | | | | C (MWFSu) [15] | | | | | | | | 06:00-06:15 - garden | +----------------------+------------------------+----------------------+------------------------+----------------------+------------------------+------------------------+ | (5) | (6) | (7) | (8) | (9) | (10) | (11) | | | | | | | | | | C (MWFSu) [15] | A (TuThSaSu) [70] | C (MWFSu) [15] | A (TuThSaSu) [70] | C (MWFSu) [15] | A (TuThSaSu) [70] | A (TuThSaSu) [70] | | 06:00-06:15 - garden | 03:30-04:00 - turf | 06:00-06:15 - garden | 03:30-04:00 - turf | 06:00-06:15 - garden | 03:30-04:00 - turf | 03:30-04:00 - turf | | | 04:00-04:30 - b shrubs | | 04:00-04:30 - b shrubs | | 04:00-04:30 - b shrubs | 04:00-04:30 - b shrubs | | | 04:30-04:40 - patio | | 04:30-04:40 - patio | | 04:30-04:40 - patio | 04:30-04:40 - patio | | | | | | | | | | | B (TuThSaSu) [50] | | B (TuThSaSu) [50] | | B (TuThSaSu) [50] | B (TuThSaSu) [50] | | | 05:00-05:50 - f shrubs | | 05:00-05:50 - f shrubs | | 05:00-05:50 - f shrubs | 05:00-05:50 - f shrubs | | | | | | | | | | | | | | | | C (MWFSu) [15] | | | | | | | | 06:00-06:15 - garden | +----------------------+------------------------+----------------------+------------------------+----------------------+------------------------+------------------------+ | (12) | (13) | (14) | (15) | (16) | (17) | (18) | | | | | | | | | | C (MWFSu) [15] | A (TuThSaSu) [70] | C (MWFSu) [15] | A (TuThSaSu) [70] | C (MWFSu) [15] | A (TuThSaSu) [70] | A (TuThSaSu) [70] | | 06:00-06:15 - garden | 03:30-04:00 - turf | 06:00-06:15 - garden | 03:30-04:00 - turf | 06:00-06:15 - garden | 03:30-04:00 - turf | 03:30-04:00 - turf | | | 04:00-04:30 - b shrubs | | 04:00-04:30 - b shrubs | | 04:00-04:30 - b shrubs | 04:00-04:30 - b shrubs | | | 04:30-04:40 - patio | | 04:30-04:40 - patio | | 04:30-04:40 - patio | 04:30-04:40 - patio | | | | | | | | | | | B (TuThSaSu) [50] | | B (TuThSaSu) [50] | | B (TuThSaSu) [50] | B (TuThSaSu) [50] | | | 05:00-05:50 - f shrubs | | 05:00-05:50 - f shrubs | | 05:00-05:50 - f shrubs | 05:00-05:50 - f shrubs | | | | | | | | | | | | | | | | C (MWFSu) [15] | | | | | | | | 06:00-06:15 - garden | +----------------------+------------------------+----------------------+------------------------+----------------------+------------------------+------------------------+ | (19) | (20) | (21) | (22) | (23) | (24) | (25) | | | | | | | | | | C (MWFSu) [15] | A (TuThSaSu) [70] | C (MWFSu) [15] | A (TuThSaSu) [70] | C (MWFSu) [15] | A (TuThSaSu) [70] | A (TuThSaSu) [70] | | 06:00-06:15 - garden | 03:30-04:00 - turf | 06:00-06:15 - garden | 03:30-04:00 - turf | 06:00-06:15 - garden | 03:30-04:00 - turf | 03:30-04:00 - turf | | | 04:00-04:30 - b shrubs | | 04:00-04:30 - b shrubs | | 04:00-04:30 - b shrubs | 04:00-04:30 - b shrubs | | | 04:30-04:40 - patio | | 04:30-04:40 - patio | | 04:30-04:40 - patio | 04:30-04:40 - patio | | | | | | | | | | | B (TuThSaSu) [50] | | B (TuThSaSu) [50] | | B (TuThSaSu) [50] | B (TuThSaSu) [50] | | | 05:00-05:50 - f shrubs | | 05:00-05:50 - f shrubs | | 05:00-05:50 - f shrubs | 05:00-05:50 - f shrubs | | | | | | | | | | | | | | | | C (MWFSu) [15] | | | | | | | | 06:00-06:15 - garden | +----------------------+------------------------+----------------------+------------------------+----------------------+------------------------+------------------------+ | (26) | (27) | (28) | (29) | (30) | | | | | | | | | | | | C (MWFSu) [15] | A (TuThSaSu) [70] | C (MWFSu) [15] | A (TuThSaSu) [70] | C (MWFSu) [15] | | | | 06:00-06:15 - garden | 03:30-04:00 - turf | 06:00-06:15 - garden | 03:30-04:00 - turf | 06:00-06:15 - garden | | | | | 04:00-04:30 - b shrubs | | 04:00-04:30 - b shrubs | | | | | | 04:30-04:40 - patio | | 04:30-04:40 - patio | | | | | | | | | | | | | | B (TuThSaSu) [50] | | B (TuThSaSu) [50] | | | | | | 05:00-05:50 - f shrubs | | 05:00-05:50 - f shrubs | | | | +----------------------+------------------------+----------------------+------------------------+----------------------+------------------------+------------------------+