From 01eabd22b328e50168d34312a0e518cbf9000319 Mon Sep 17 00:00:00 2001 From: Nitwel Date: Sun, 10 Dec 2023 19:25:15 +0100 Subject: [PATCH] wait for connect on sensor --- content/entities/sensor/sensor.gd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/content/entities/sensor/sensor.gd b/content/entities/sensor/sensor.gd index 78fd781..fff70fb 100644 --- a/content/entities/sensor/sensor.gd +++ b/content/entities/sensor/sensor.gd @@ -5,6 +5,9 @@ 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)