WIP: Timer component (#9889)

* Added timer component

* Reworked functionality a bit

* Fixed requested change

* Fixed state updates when finished

* Removing expired listeners, added events, changed services

* Added finish service

* Using timedelta parameters in start-service

* Cleanup

* Lint

* Updating state for remaining time

* Removed duration from cancel method

* Renamed service to fix disabled lint

* Some tests (incomplete)

* Relocated service descriptions

* Addressed requested changes

* Adjusted tests, added methods and events

* Added test for finish service, lint

* Code cleanp, using string states

* tzzz... one char...

* Proper usage of restore_state

* Some more cleanup
This commit is contained in:
Daniel Perna authored and Paulus Schoutsen committed 2017-10-31 20:20:56 -07:00
1 parent 253c8aee1f
commit 890c11cc7c
3 files changed
+553

No files matched your search

@@ -0,0 +1,34 @@
start:
description: Start a timer.
fields:
entity_id:
description: Entity id of the timer to start. [optional]
example: 'timer.timer0'
duration:
description: Duration the timer requires to finish. [optional]
example: '00:01:00 or 60'
pause:
description: Pause a timer.
fields:
entity_id:
description: Entity id of the timer to pause. [optional]
example: 'timer.timer0'
cancel:
description: Cancel a timer.
fields:
entity_id:
description: Entity id of the timer to cancel. [optional]
example: 'timer.timer0'
finish:
description: Finish a timer.
fields:
entity_id:
description: Entity id of the timer to finish. [optional]
example: 'timer.timer0'