immersive-home/app/lib/home_apis/hass_ws/handlers/integration.gd

21 lines
505 B
GDScript3
Raw Normal View History

2024-03-11 19:09:50 +02:00
const HASS_API = preload ("../hass.gd")
var api: HASS_API
var integration_exists: bool = false
func _init(hass: HASS_API):
self.api = hass
2024-05-20 13:53:22 +03:00
test_integration.call_deferred()
2024-03-11 19:09:50 +02:00
2024-05-20 13:53:22 +03:00
func test_integration():
var response = await api.connection.send_request_packet({
2024-03-11 19:09:50 +02:00
"type": "immersive_home/register",
"device_id": OS.get_unique_id(),
"name": OS.get_model_name(),
"version": OS.get_version(),
"platform": OS.get_name(),
})
if response.status == Promise.Status.RESOLVED:
2024-05-20 13:53:22 +03:00
integration_exists = true