Make State class immutable

This commit is contained in:
Paulus Schoutsen committed 2016-02-09 23:27:01 -08:00
1 parent 70a528c04b
commit b0948bef5f
6 files changed
+10 -29

No files matched your search

+1 -1
View File
@@ -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)
+1 -1
View File
@@ -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