We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents be3f98e + 1de2cd8 commit 8025df4Copy full SHA for 8025df4
custom_components/pyscript/state.py
@@ -13,7 +13,7 @@
13
14
_LOGGER = logging.getLogger(LOGGER_PATH + ".state")
15
16
-STATE_VIRTUAL_ATTRS = {"entity_id", "last_changed", "last_updated"}
+STATE_VIRTUAL_ATTRS = {"entity_id", "last_changed", "last_updated", "last_reported"}
17
18
19
class StateVal(str):
@@ -26,6 +26,7 @@ def __new__(cls, state):
26
new_var.entity_id = state.entity_id
27
new_var.last_updated = state.last_updated
28
new_var.last_changed = state.last_changed
29
+ new_var.last_reported = state.last_reported
30
return new_var
31
32
docs/reference.rst
@@ -262,12 +262,13 @@ Here's an example using ``input_number``, assuming it has been configured to cre
262
input_number.test.set_value(value=13)
263
input_number.test.set_value(13)
264
265
-Three additional virtual attribute values are available when you use a variable directly as
+Four additional virtual attribute values are available when you use a variable directly as
266
``DOMAIN.entity.attr`` or call ``state.get("DOMAIN.entity.attr")``:
267
268
- ``entity_id`` is the DOMAIN.entity as string
269
- ``last_changed`` is the last UTC time the state value was changed (not the attributes)
270
- ``last_updated`` is the last UTC time the state entity was updated
271
+- ``last_reported``is the last UTC time the integration set the state of an entity, regardless of whether it changed or not
272
273
If you need to compute how many seconds ago the ``binary_sensor.test1`` state changed, you could
274
do this:
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments