File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
custom_components/pyscript Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 12
12
13
13
_LOGGER = logging .getLogger (LOGGER_PATH + ".state" )
14
14
15
+ STATE_VIRTUAL_ATTRS = {"last_updated" , "last_changed" }
15
16
16
17
class StateVar (str ):
17
18
"""Class for representing the value and attributes of a state variable."""
Original file line number Diff line number Diff line change 17
17
from .eval import AstEval
18
18
from .event import Event
19
19
from .function import Function
20
- from .state import State
20
+ from .state import State , STATE_VIRTUAL_ATTRS
21
21
22
22
_LOGGER = logging .getLogger (LOGGER_PATH + ".trigger" )
23
23
@@ -675,7 +675,7 @@ def ident_any_values_changed(self, func_args):
675
675
all_attributes |= set (value .__dict__ .keys ())
676
676
if old_value is not None :
677
677
all_attributes |= set (old_value .__dict__ .keys ())
678
- all_attributes -= { "last_updated" , "last_changed" }
678
+ all_attributes -= STATE_VIRTUAL_ATTRS
679
679
for attribute in all_attributes :
680
680
attrib_val = getattr (value , attribute , None )
681
681
attrib_old_val = getattr (old_value , attribute , None )
You can’t perform that action at this time.
0 commit comments