From 6d1c7a0d53a74a081b4900f1aa5c7c26b8159945 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Wiedemann?= Date: Mon, 1 Feb 2021 18:59:21 +0000 Subject: [PATCH] doc: Fix error `data_generator` example Fixes #34 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e838661..0a338cc 100644 --- a/README.md +++ b/README.md @@ -324,7 +324,7 @@ Let's take this example: - entity: sensor.test data_generator: | # This is what builds the data return entity.attributes.PeakTimes.map((peak, index) => { - return [new Date(peak), entity.attributes.PeakHeights[index]]; + return [new Date(peak).getTime(), entity.attributes.PeakHeights[index]]; }); ``` The result of this function call would be something like: