Make State class immutable
This commit is contained in:
1 parent
70a528c04b
commit
b0948bef5f
6 files changed
+10
-29
No files matched your search
@@ -141,7 +141,7 @@ class Configurator(object):
|
||||
|
||||
state = self.hass.states.get(entity_id)
|
||||
|
||||
new_data = state.attributes
|
||||
new_data = dict(state.attributes)
|
||||
new_data[ATTR_ERRORS] = error
|
||||
|
||||
self.hass.states.set(entity_id, STATE_CONFIGURE, new_data)
|
||||
|
||||
@@ -232,7 +232,7 @@ class Recorder(threading.Thread):
|
||||
else:
|
||||
state_domain = state.domain
|
||||
state_state = state.state
|
||||
state_attr = json.dumps(state.attributes)
|
||||
state_attr = json.dumps(dict(state.attributes))
|
||||
last_changed = state.last_changed
|
||||
last_updated = state.last_updated
|
||||
|
||||
|
||||
Reference in new issue
Block a user