diff --git a/content/entities/sensor/sensor.gd b/content/entities/sensor/sensor.gd index fff70fb..78fd781 100644 --- a/content/entities/sensor/sensor.gd +++ b/content/entities/sensor/sensor.gd @@ -5,9 +5,6 @@ extends StaticBody3D # Called when the node enters the scene tree for the first time. func _ready(): - if HomeApi.has_connected() == false: - await HomeApi.on_connect - var stateInfo = await HomeApi.get_state(entity_id) set_text(stateInfo) diff --git a/lib/globals/save_system.gd b/lib/globals/save_system.gd index edfe035..db78878 100644 --- a/lib/globals/save_system.gd +++ b/lib/globals/save_system.gd @@ -85,10 +85,13 @@ func _generate_save_tree(node: Node): func _build_save_tree(tree: Dictionary): var new_object = load(tree["filename"]).instantiate() - get_node(tree["parent"]).add_child(new_object) - if new_object.has_method("_load"): new_object.call("_load", VariantSerializer.parse_value(tree["data"])) else: for key in tree["data"].keys(): new_object.set(key, VariantSerializer.parse_value(tree["data"][key])) + + get_node(tree["parent"]).add_child(new_object) + + for child in tree["children"]: + _build_save_tree(child)