diff --git a/components/hauslane/hauslane.cpp b/components/hauslane/hauslane.cpp index 6f44562..7f38839 100644 --- a/components/hauslane/hauslane.cpp +++ b/components/hauslane/hauslane.cpp @@ -30,7 +30,9 @@ void Hauslane::setup() { } // register ESPHome API service named "command" +#if defined(USE_API) register_service(&Hauslane::command, "command", {"command"}); +#endif } void Hauslane::loop() { diff --git a/components/hauslane/hauslane.h b/components/hauslane/hauslane.h index 766fb57..9b10b2c 100644 --- a/components/hauslane/hauslane.h +++ b/components/hauslane/hauslane.h @@ -2,7 +2,9 @@ #include "esphome/core/component.h" #include "esphome/components/uart/uart.h" +#ifdef USE_API #include "esphome/components/api/custom_api_device.h" +#endif #ifdef USE_LIGHT #include "esphome/components/light/light_output.h" #endif diff --git a/uc-ps18.yaml b/uc-ps18.yaml index 86889aa..17ab65b 100644 --- a/uc-ps18.yaml +++ b/uc-ps18.yaml @@ -19,6 +19,7 @@ logger: level: DEBUG api: + custom_services: true password: !secret api_password ota: