2023-11-03 23:00:05 +02:00
|
|
|
extends StaticBody3D
|
|
|
|
|
|
|
|
@export var entity_id = "sensor.sun_next_dawn"
|
|
|
|
@onready var label: Label3D = $Label
|
|
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
|
|
func _ready():
|
2023-11-05 17:36:13 +02:00
|
|
|
var stateInfo = await HomeAdapters.adapter.get_state(entity_id)
|
2023-11-03 23:00:05 +02:00
|
|
|
label.text = stateInfo["state"]
|
|
|
|
|
2023-11-05 17:36:13 +02:00
|
|
|
await HomeAdapters.adapter.watch_state(entity_id, func(new_state):
|
2023-11-03 23:00:05 +02:00
|
|
|
label.text = new_state["state"]
|
|
|
|
)
|
|
|
|
|
2023-11-05 22:32:50 +02:00
|
|
|
func _on_click(event):
|
2023-11-03 23:00:05 +02:00
|
|
|
pass
|