control: Add optional delay to count_state_floor

Add an optional delay field to the count_state_floor action that takes a
value in seconds. When set to a nonzero value, the action will then
require the count condition to be satisfied for that amount of time
before setting the floor.  This can be used to prevent the floor from
jumping when there is just short change to a property value, for example
if a sensor set to not functional for a short amount of time.

For example:

{
    "name": "count_state_floor",
    "count": 1,
    "state": false,
    "delay": 5,
    "floor": 18000
}

This says that the floor won't be set to 18000 until at least 1 group
member has its property value set to false for a continuous 5 seconds.

Signed-off-by: Matt Spinler <spinler@us.ibm.com>
Change-Id: I67409ce651d9592b1cabb3f7cb36ba998c3ef545
3 files changed