Commit graph

10 commits

Author SHA1 Message Date
Paulus Schoutsen
6899c7b6f7 assertEquals is deprecated () 2017-05-25 22:21:22 -07:00
Fabian Affolter
be272ac64a Disable too-many-* ()
* Disable too-many-* and too-few-public-methods

* Remove globally disabled pylint warnings
2016-10-30 22:18:53 +01:00
Fabian Heredia Montiel
d4f78e8552 Type Hints - Core/Utils/Helpers Part 1 ()
* Fix deprecated(moved) import

* Add util/dt typing

* Green on mypy util/dt

* Fix some errors

* First part of yping util/yaml

* Add more typing to util/yaml
2016-07-23 11:07:08 -07:00
Daniel Høyer Iversen
630b7377bd Refactor get_age in util/dt () 2016-05-14 12:05:46 -07:00
Robbie Trencheny
b75aa6ac08 Add get_age tests 2016-05-11 22:29:55 -07:00
Charles Spirakis
b86a1ece01 Allow conversion from date strings to "unix" timestamp. ()
"unix" timestamp is number of seconds since Jan 1, 1970 UTC.
This allows scripts that use templates to generate time
deltas in seconds if desired from state attributes such
as last_updated.

Some examples:

timestamp now is
{{ as_timestamp(now) }}

timstamp of last change is
{{ as_timestamp(states.binary_sensor.garage_door.last_changed) }}

seconds since last change is
{{ as_timestamp(now) - as_timestamp(states.binary_sensor.garage_door.last_changed) }}
2016-05-06 18:33:46 -07:00
Paulus Schoutsen
68d92c3196 Use standardised datetime format 2016-04-16 01:46:50 -07:00
Fabian Affolter
9838697d2b Fix PEP257 issues 2016-03-09 10:25:50 +01:00
Fabian Affolter
00afaac54c Update for file header, docstrings, and PEP8/PEP257 2016-02-13 14:19:11 +01:00
Paulus Schoutsen
0c56fde5a9 Reorg tests folder 2015-07-26 10:17:01 +02:00
Renamed from tests/test_util_dt.py (Browse further)