fix component API include compile error
This commit is contained in:
@@ -1,6 +1,10 @@
|
|||||||
#include "esphome/core/log.h"
|
#include "esphome/core/log.h"
|
||||||
#include "hauslane.h"
|
#include "hauslane.h"
|
||||||
|
|
||||||
|
#if defined(USE_API)
|
||||||
|
#include "esphome/components/api/custom_api_device.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
namespace hauslane {
|
namespace hauslane {
|
||||||
|
|
||||||
@@ -30,7 +34,9 @@ void Hauslane::setup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// register ESPHome API service named "command"
|
// register ESPHome API service named "command"
|
||||||
|
#if defined(USE_API)
|
||||||
register_service(&Hauslane::command, "command", {"command"});
|
register_service(&Hauslane::command, "command", {"command"});
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Hauslane::loop() {
|
void Hauslane::loop() {
|
||||||
|
|||||||
Reference in New Issue
Block a user