From cc038ec0a2e06585262f0c16b23a26b51638f001 Mon Sep 17 00:00:00 2001 From: Drath Date: Fri, 12 Sep 2025 23:36:07 +0200 Subject: [PATCH] support timeout --- include/hass.hpp | 2 +- src/hass.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/hass.hpp b/include/hass.hpp index 16f74c6..7ba7415 100644 --- a/include/hass.hpp +++ b/include/hass.hpp @@ -13,7 +13,7 @@ #define HASS_ENTITY "sensor.gniazdko_komputer_moc" int hass_connect(); -void hass_poll(); +void hass_service(int timeout_ms = 0); float hass_get(); void hass_disconnect(); diff --git a/src/hass.cpp b/src/hass.cpp index ce854f3..d9d697f 100644 --- a/src/hass.cpp +++ b/src/hass.cpp @@ -139,9 +139,9 @@ int hass_connect() { return 0; } -void hass_poll() { - lws_service(context, 0); +void hass_service(int timeout_ms) { lws_callback_on_writable(websock); + lws_service(context, timeout_ms); } float hass_get() {