Skip to content

Commit

Permalink
ota support
Browse files Browse the repository at this point in the history
  • Loading branch information
darvik80 committed May 11, 2024
1 parent 4ad7446 commit 0136041
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 121 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-missing-field-initializers")

list(APPEND EXTRA_COMPONENT_DIRS libs/darvik)
list(APPEND EXTRA_COMPONENT_DIRS libs/3pl-libs/led_strip)
list(APPEND EXTRA_COMPONENT_DIRS libs/3pl-libs/fmt)

project(magic-lamp-espidf)

4 changes: 2 additions & 2 deletions dependencies.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ dependencies:
component_hash: null
source:
type: idf
version: 5.2.0
manifest_hash: 72be3d069e489c3e37f80dc568bbd2e7eb18e59d9642be748c479dc440a29aa4
version: 5.1.2
manifest_hash: cf895af9d56c5310cb1a29947fb9dd3eba08704b37120e2fac623e72adfe38e6
target: esp32c3
version: 1.0.0
6 changes: 4 additions & 2 deletions main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,16 +100,18 @@ class MagicLampApplication
getRegistry().create<OtaService>();
getRegistry().create<TelemetryService>();
auto &mqtt = getRegistry().create<MqttService>();
mqtt.addJsonHandler<OtaUpdate>("/ota", MQTT_SUB_RELATIVE);
mqtt.addJsonHandler<MagicActionEvent>("/action", MQTT_SUB_RELATIVE);
mqtt.addJsonProcessor<SystemEventChanged>("/telemetry");
mqtt.addJsonProcessor<Telemetry>("/telemetry");

getRegistry().create<IrReceiver>((gpio_num_t) 10);

LedStrip &led1 = getRegistry().create<LedStripService<Service_App_LedStatus, 3, 4>>();
auto &led1 = getRegistry().create<LedStripService<Service_App_LedStatus, 3, 4>>();
led1.setColor(0, 3, LedColor{.red=0x01, .green= 0x00, .blue=0x00});
led1.refresh();

LedStrip &led2 = getRegistry().create<LedStripService<Service_App_LedCircle, 2, 12>>();
auto &led2 = getRegistry().create<LedStripService<Service_App_LedCircle, 2, 12>>();
led2.setColor(0, 11, LedColor{.red=0x8b, .green= 0x10, .blue=0x00});
led2.refresh();
}
Expand Down
Loading

0 comments on commit 0136041

Please sign in to comment.