From c3fe4fd0cd4304c461852789f752c447c2c4f6dd Mon Sep 17 00:00:00 2001
From: Jens Nolte <jens@nightmarestudio.de>
Date: Sat, 27 Jun 2020 18:45:38 +0200
Subject: [PATCH] Move headers to `qthing/` path and move envronment

---
 .gitignore                                    |  2 +-
 CMakeLists.txt                                |  1 +
 bin/set-environment                           |  8 ++++----
 generated/CMakeLists.txt                      |  4 ++++
 qthing/CMakeLists.txt                         |  4 ++++
 qthing/color.cpp                              |  2 +-
 qthing/error.cpp                              |  2 +-
 qthing/event.cpp                              |  4 ++--
 qthing/include/qthing.hpp                     | 12 ++++++------
 qthing/include/{ => qthing}/device.hpp        |  0
 qthing/include/{ => qthing}/error.hpp         |  0
 qthing/include/{ => qthing}/event.hpp         |  0
 qthing/include/{ => qthing}/io.hpp            |  0
 qthing/include/{ => qthing}/led_strip.hpp     |  0
 qthing/include/{ => qthing}/measured.hpp      |  0
 qthing/include/{ => qthing}/mqtt.hpp          |  0
 qthing/include/{ => qthing}/mqtt_c.h          |  0
 qthing/include/{ => qthing}/mqtt_common.h     |  0
 qthing/include/{ => qthing}/mqtt_ota.hpp      |  0
 qthing/include/{ => qthing}/network.hpp       |  0
 qthing/include/{ => qthing}/oled_symbols.hpp  |  0
 qthing/include/{ => qthing}/polyfill.hpp      |  0
 qthing/include/{ => qthing}/power.hpp         |  0
 qthing/include/{ => qthing}/qthing_legacy.hpp |  1 +
 qthing/include/{ => qthing}/rc_433.hpp        |  0
 qthing/include/{ => qthing}/sensor.hpp        |  0
 qthing/include/{ => qthing}/time.hpp          |  0
 qthing/include/{ => qthing}/udp.hpp           |  0
 qthing/include/{ => qthing}/util.hpp          |  0
 qthing/io.cpp                                 |  8 ++++----
 qthing/lcd.cpp                                |  6 +++---
 qthing/{include => magic-include}/qthing      |  0
 qthing/main.cpp                               |  2 +-
 qthing/measured.cpp                           |  6 +++---
 qthing/mqtt.cpp                               | 12 ++++++------
 qthing/mqtt_c.c                               |  4 ++--
 qthing/mqtt_ota.cpp                           |  6 +++---
 qthing/network/ethernet_lan8720.cpp           |  4 ++--
 qthing/network/network.cpp                    | 10 +++++-----
 qthing/network/network_animation.cpp          |  8 ++++----
 qthing/network/udp.cpp                        |  2 +-
 qthing/network/wifi.cpp                       | 10 +++++-----
 qthing/ntp.cpp                                |  2 +-
 qthing/oled.cpp                               |  8 ++++----
 qthing/peripherals/button_panel_5x5.cpp       |  4 ++--
 qthing/peripherals/led_strip.cpp              |  6 +++---
 qthing/rc_433.cpp                             |  4 ++--
 qthing/sensor.cpp                             |  6 +++---
 qthing/status.cpp                             |  6 +++---
 qthing/system/power.cpp                       |  4 ++--
 qthing/system/time.cpp                        |  2 +-
 qthing/util.cpp                               |  4 ++--
 52 files changed, 87 insertions(+), 77 deletions(-)
 create mode 100644 generated/CMakeLists.txt
 rename qthing/include/{ => qthing}/device.hpp (100%)
 rename qthing/include/{ => qthing}/error.hpp (100%)
 rename qthing/include/{ => qthing}/event.hpp (100%)
 rename qthing/include/{ => qthing}/io.hpp (100%)
 rename qthing/include/{ => qthing}/led_strip.hpp (100%)
 rename qthing/include/{ => qthing}/measured.hpp (100%)
 rename qthing/include/{ => qthing}/mqtt.hpp (100%)
 rename qthing/include/{ => qthing}/mqtt_c.h (100%)
 rename qthing/include/{ => qthing}/mqtt_common.h (100%)
 rename qthing/include/{ => qthing}/mqtt_ota.hpp (100%)
 rename qthing/include/{ => qthing}/network.hpp (100%)
 rename qthing/include/{ => qthing}/oled_symbols.hpp (100%)
 rename qthing/include/{ => qthing}/polyfill.hpp (100%)
 rename qthing/include/{ => qthing}/power.hpp (100%)
 rename qthing/include/{ => qthing}/qthing_legacy.hpp (99%)
 rename qthing/include/{ => qthing}/rc_433.hpp (100%)
 rename qthing/include/{ => qthing}/sensor.hpp (100%)
 rename qthing/include/{ => qthing}/time.hpp (100%)
 rename qthing/include/{ => qthing}/udp.hpp (100%)
 rename qthing/include/{ => qthing}/util.hpp (100%)
 rename qthing/{include => magic-include}/qthing (100%)

diff --git a/.gitignore b/.gitignore
index 763ce79..5a041d8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -14,4 +14,4 @@ sdkconfig.old
 # This directory contains user-specific environment configurations
 /environments/*
 # Ignore symlink to current environment
-/qthing/include/environment.h
+/generated/environment.h
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 177652e..56d642b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,4 +4,5 @@ cmake_minimum_required(VERSION 3.5)
 
 include($ENV{IDF_PATH}/tools/cmake/project.cmake)
 idf_build_component(qthing)
+idf_build_component(generated)
 project(qthing)
diff --git a/bin/set-environment b/bin/set-environment
index d944669..6b6ecb0 100755
--- a/bin/set-environment
+++ b/bin/set-environment
@@ -12,9 +12,9 @@ function list_known_environments {
 }
 
 function link_environment {
-    echo "Linking qthing/include/environment.h to $1"
-    ln -snf "$1" "${QTHING_PATH:-.}/qthing/include/environment.h"
-    touch --no-create "${QTHING_PATH:-.}/qthing/include/environment.h"
+    echo "Linking generated/environment.h to $1"
+    ln -snf "$1" "${QTHING_PATH:-.}/generated/environment.h"
+    touch --no-create "${QTHING_PATH:-.}/generated/environment.h"
 }
 
 if [[ -z "$1" ]]; then
@@ -23,7 +23,7 @@ if [[ -z "$1" ]]; then
 elif [[ -f "$1" && "$1" == *.h ]]; then
     link_environment "$1"
 elif [[ -f "${QTHING_PATH:-.}/environments/$1.h" ]]; then
-    link_environment "../../environments/$1.h"
+    link_environment "../environments/$1.h"
 else
     echo "Cannot find environment config in the following locations:"
     echo "$1"
diff --git a/generated/CMakeLists.txt b/generated/CMakeLists.txt
new file mode 100644
index 0000000..ee7be01
--- /dev/null
+++ b/generated/CMakeLists.txt
@@ -0,0 +1,4 @@
+idf_component_register(
+  INCLUDE_DIRS
+  "."
+)
diff --git a/qthing/CMakeLists.txt b/qthing/CMakeLists.txt
index 21a3d2c..427d35f 100644
--- a/qthing/CMakeLists.txt
+++ b/qthing/CMakeLists.txt
@@ -7,15 +7,19 @@ idf_component_register(
 
   INCLUDE_DIRS
   "include"
+  "magic-include"
 
   REQUIRES
   ESP32-Digital-RGB-LED-Drivers
   LiquidCrystal
   app_update
   arduino-esp32
+  generated
   main
   mqtt
   nvs_flash
   rc-switch
 )
 component_compile_options(-std=c++17)
+component_compile_options(-fdiagnostics-color=always)
+component_compile_options(-Wall)
diff --git a/qthing/color.cpp b/qthing/color.cpp
index 35bd34e..43a4683 100644
--- a/qthing/color.cpp
+++ b/qthing/color.cpp
@@ -1,6 +1,6 @@
 #include <cmath>
 
-#include "qthing_legacy.hpp"
+#include "qthing/qthing_legacy.hpp"
 
 namespace qthing {
 // TODO: should return RGB once that can be casted to RGBW
diff --git a/qthing/error.cpp b/qthing/error.cpp
index 828a49d..8e231fe 100644
--- a/qthing/error.cpp
+++ b/qthing/error.cpp
@@ -1,4 +1,4 @@
-#include "error.hpp"
+#include "qthing/error.hpp"
 
 void qthing::errorCodeToException(esp_err_t errorNumber) {
   if (errorNumber != ESP_OK) {
diff --git a/qthing/event.cpp b/qthing/event.cpp
index 46616d6..44928f9 100644
--- a/qthing/event.cpp
+++ b/qthing/event.cpp
@@ -1,6 +1,6 @@
-#include "event.hpp"
+#include "qthing/event.hpp"
 
-#include "qthing_legacy.hpp"
+#include "qthing/qthing_legacy.hpp"
 
 namespace qthing {
 
diff --git a/qthing/include/qthing.hpp b/qthing/include/qthing.hpp
index 7708b3b..8da6c22 100644
--- a/qthing/include/qthing.hpp
+++ b/qthing/include/qthing.hpp
@@ -2,11 +2,11 @@
 
 #define QTHING_HIDE_PRIVATE_API
 
-#include "error.hpp"
-#include "network.hpp"
-#include "power.hpp"
-#include "qthing_legacy.hpp"
-#include "time.hpp"
-#include "util.hpp"
+#include "qthing/error.hpp"
+#include "qthing/network.hpp"
+#include "qthing/power.hpp"
+#include "qthing/qthing_legacy.hpp"
+#include "qthing/time.hpp"
+#include "qthing/util.hpp"
 
 #undef QTHING_HIDE_PRIVATE_API
diff --git a/qthing/include/device.hpp b/qthing/include/qthing/device.hpp
similarity index 100%
rename from qthing/include/device.hpp
rename to qthing/include/qthing/device.hpp
diff --git a/qthing/include/error.hpp b/qthing/include/qthing/error.hpp
similarity index 100%
rename from qthing/include/error.hpp
rename to qthing/include/qthing/error.hpp
diff --git a/qthing/include/event.hpp b/qthing/include/qthing/event.hpp
similarity index 100%
rename from qthing/include/event.hpp
rename to qthing/include/qthing/event.hpp
diff --git a/qthing/include/io.hpp b/qthing/include/qthing/io.hpp
similarity index 100%
rename from qthing/include/io.hpp
rename to qthing/include/qthing/io.hpp
diff --git a/qthing/include/led_strip.hpp b/qthing/include/qthing/led_strip.hpp
similarity index 100%
rename from qthing/include/led_strip.hpp
rename to qthing/include/qthing/led_strip.hpp
diff --git a/qthing/include/measured.hpp b/qthing/include/qthing/measured.hpp
similarity index 100%
rename from qthing/include/measured.hpp
rename to qthing/include/qthing/measured.hpp
diff --git a/qthing/include/mqtt.hpp b/qthing/include/qthing/mqtt.hpp
similarity index 100%
rename from qthing/include/mqtt.hpp
rename to qthing/include/qthing/mqtt.hpp
diff --git a/qthing/include/mqtt_c.h b/qthing/include/qthing/mqtt_c.h
similarity index 100%
rename from qthing/include/mqtt_c.h
rename to qthing/include/qthing/mqtt_c.h
diff --git a/qthing/include/mqtt_common.h b/qthing/include/qthing/mqtt_common.h
similarity index 100%
rename from qthing/include/mqtt_common.h
rename to qthing/include/qthing/mqtt_common.h
diff --git a/qthing/include/mqtt_ota.hpp b/qthing/include/qthing/mqtt_ota.hpp
similarity index 100%
rename from qthing/include/mqtt_ota.hpp
rename to qthing/include/qthing/mqtt_ota.hpp
diff --git a/qthing/include/network.hpp b/qthing/include/qthing/network.hpp
similarity index 100%
rename from qthing/include/network.hpp
rename to qthing/include/qthing/network.hpp
diff --git a/qthing/include/oled_symbols.hpp b/qthing/include/qthing/oled_symbols.hpp
similarity index 100%
rename from qthing/include/oled_symbols.hpp
rename to qthing/include/qthing/oled_symbols.hpp
diff --git a/qthing/include/polyfill.hpp b/qthing/include/qthing/polyfill.hpp
similarity index 100%
rename from qthing/include/polyfill.hpp
rename to qthing/include/qthing/polyfill.hpp
diff --git a/qthing/include/power.hpp b/qthing/include/qthing/power.hpp
similarity index 100%
rename from qthing/include/power.hpp
rename to qthing/include/qthing/power.hpp
diff --git a/qthing/include/qthing_legacy.hpp b/qthing/include/qthing/qthing_legacy.hpp
similarity index 99%
rename from qthing/include/qthing_legacy.hpp
rename to qthing/include/qthing/qthing_legacy.hpp
index 4f4fbf8..76bb806 100644
--- a/qthing/include/qthing_legacy.hpp
+++ b/qthing/include/qthing/qthing_legacy.hpp
@@ -238,6 +238,7 @@ uint32_t get_key_activation_time(uint8_t x, uint8_t y);
 
 // utility
 std::string to_string(float value, int precision = 2);
+std::string to_string(double value, int precision = 2);
 std::string to_string(uint32_t value);
 std::string to_string(struct sockaddr_in6 sourceAddr);
 
diff --git a/qthing/include/rc_433.hpp b/qthing/include/qthing/rc_433.hpp
similarity index 100%
rename from qthing/include/rc_433.hpp
rename to qthing/include/qthing/rc_433.hpp
diff --git a/qthing/include/sensor.hpp b/qthing/include/qthing/sensor.hpp
similarity index 100%
rename from qthing/include/sensor.hpp
rename to qthing/include/qthing/sensor.hpp
diff --git a/qthing/include/time.hpp b/qthing/include/qthing/time.hpp
similarity index 100%
rename from qthing/include/time.hpp
rename to qthing/include/qthing/time.hpp
diff --git a/qthing/include/udp.hpp b/qthing/include/qthing/udp.hpp
similarity index 100%
rename from qthing/include/udp.hpp
rename to qthing/include/qthing/udp.hpp
diff --git a/qthing/include/util.hpp b/qthing/include/qthing/util.hpp
similarity index 100%
rename from qthing/include/util.hpp
rename to qthing/include/qthing/util.hpp
diff --git a/qthing/io.cpp b/qthing/io.cpp
index 82a1ef2..037e029 100644
--- a/qthing/io.cpp
+++ b/qthing/io.cpp
@@ -1,4 +1,4 @@
-#include "io.hpp"
+#include "qthing/io.hpp"
 
 #include <algorithm>
 
@@ -7,9 +7,9 @@
 #include "freertos/FreeRTOS.h"
 #include "freertos/queue.h"
 #include "freertos/task.h"
-#include "mqtt.hpp"
-#include "qthing_legacy.hpp"
-#include "util.hpp"
+#include "qthing/mqtt.hpp"
+#include "qthing/qthing_legacy.hpp"
+#include "qthing/util.hpp"
 
 #define TAG "IO"
 
diff --git a/qthing/lcd.cpp b/qthing/lcd.cpp
index 7aa692e..8d7e208 100644
--- a/qthing/lcd.cpp
+++ b/qthing/lcd.cpp
@@ -4,9 +4,9 @@
 
 #include "Arduino.h"
 #include "LiquidCrystal.h"
-#include "mqtt.hpp"
-#include "network.hpp"
-#include "qthing_legacy.hpp"
+#include "qthing/mqtt.hpp"
+#include "qthing/network.hpp"
+#include "qthing/qthing_legacy.hpp"
 
 namespace qthing {
 
diff --git a/qthing/include/qthing b/qthing/magic-include/qthing
similarity index 100%
rename from qthing/include/qthing
rename to qthing/magic-include/qthing
diff --git a/qthing/main.cpp b/qthing/main.cpp
index 1cf4cd4..4fcb4b3 100644
--- a/qthing/main.cpp
+++ b/qthing/main.cpp
@@ -1,3 +1,3 @@
-#include "device.hpp"
+#include "qthing/device.hpp"
 
 extern "C" void app_main() { device_main(); }
diff --git a/qthing/measured.cpp b/qthing/measured.cpp
index 989a241..c87d396 100644
--- a/qthing/measured.cpp
+++ b/qthing/measured.cpp
@@ -1,4 +1,4 @@
-#include "measured.hpp"
+#include "qthing/measured.hpp"
 
 #include <string>
 #include <vector>
@@ -6,8 +6,8 @@
 #include "esp_log.h"
 #include "freertos/FreeRTOS.h"
 #include "freertos/task.h"
-#include "mqtt_common.h"
-#include "qthing_legacy.hpp"
+#include "qthing/mqtt_common.h"
+#include "qthing/qthing_legacy.hpp"
 
 typedef struct {
   std::string name;
diff --git a/qthing/mqtt.cpp b/qthing/mqtt.cpp
index cbf1283..ffe68eb 100644
--- a/qthing/mqtt.cpp
+++ b/qthing/mqtt.cpp
@@ -1,4 +1,4 @@
-#include "mqtt.hpp"
+#include "qthing/mqtt.hpp"
 
 #include <stddef.h>
 #include <stdint.h>
@@ -12,22 +12,22 @@
 #include "esp_event_loop.h"
 #include "esp_log.h"
 #include "esp_system.h"
-#include "event.hpp"
 #include "freertos/FreeRTOS.h"
 #include "freertos/event_groups.h"
 #include "freertos/queue.h"
 #include "freertos/semphr.h"
 #include "freertos/task.h"
-#include "io.hpp"
 #include "lwip/dns.h"
 #include "lwip/netdb.h"
 #include "lwip/sockets.h"
-#include "mqtt_common.h"
-#include "mqtt_ota.hpp"
+#include "qthing/mqtt_common.h"
+#include "qthing/mqtt_ota.hpp"
+#include "qthing/event.hpp"
+#include "qthing/io.hpp"
 
 extern "C" {
-#include "mqtt_c.h"
 #include "mqtt_client.h"
+#include "qthing/mqtt_c.h"
 }
 
 #define TAG "MQTT"
diff --git a/qthing/mqtt_c.c b/qthing/mqtt_c.c
index d43f020..938da9c 100644
--- a/qthing/mqtt_c.c
+++ b/qthing/mqtt_c.c
@@ -1,7 +1,7 @@
-#include "mqtt_c.h"
+#include "qthing/mqtt_c.h"
 
 #include "environment.h"
-#include "mqtt_common.h"
+#include "qthing/mqtt_common.h"
 
 esp_mqtt_client_handle_t mqtt_client_start_c(mqtt_event_callback_t mqtt_event_handler) {
   const esp_mqtt_client_config_t mqtt_cfg = {
diff --git a/qthing/mqtt_ota.cpp b/qthing/mqtt_ota.cpp
index 30a7f0c..f7cdf56 100644
--- a/qthing/mqtt_ota.cpp
+++ b/qthing/mqtt_ota.cpp
@@ -1,11 +1,11 @@
-#include "mqtt_ota.hpp"
+#include "qthing/mqtt_ota.hpp"
 
 #include "esp_err.h"
 #include "esp_log.h"
 #include "esp_ota_ops.h"
 #include "esp_system.h"
-#include "mqtt_common.h"
-#include "qthing_legacy.hpp"
+#include "qthing/mqtt_common.h"
+#include "qthing/qthing_legacy.hpp"
 
 #define TAG "MQTT_OTA"
 
diff --git a/qthing/network/ethernet_lan8720.cpp b/qthing/network/ethernet_lan8720.cpp
index 25f3b23..0f11ce3 100644
--- a/qthing/network/ethernet_lan8720.cpp
+++ b/qthing/network/ethernet_lan8720.cpp
@@ -4,13 +4,13 @@
 #include "device_config.h"
 #include "driver/gpio.h"
 #include "environment.h"
-#include "error.hpp"
+#include "qthing/error.hpp"
 #include "esp_eth.h"
 #include "esp_event.h"
 #include "esp_log.h"
 #include "freertos/FreeRTOS.h"
 #include "freertos/task.h"
-#include "network.hpp"
+#include "qthing/network.hpp"
 #include "tcpip_adapter.h"
 
 static const char* TAG = "ethernet";
diff --git a/qthing/network/network.cpp b/qthing/network/network.cpp
index f4aa6ce..fc945f0 100644
--- a/qthing/network/network.cpp
+++ b/qthing/network/network.cpp
@@ -5,16 +5,16 @@
 #include "esp_event_loop.h"
 #include "esp_log.h"
 #include "esp_wifi.h"
-#include "event.hpp"
+#include "qthing/event.hpp"
 #include "freertos/FreeRTOS.h"
 #include "freertos/event_groups.h"
 #include "freertos/task.h"
-#include "io.hpp"
-#include "mqtt.hpp"
+#include "qthing/io.hpp"
+#include "qthing/mqtt.hpp"
 #include "nvs_flash.h"
-#include "qthing_legacy.hpp"
+#include "qthing/qthing_legacy.hpp"
 #include "string.h"
-#include "udp.hpp"
+#include "qthing/udp.hpp"
 
 #define TAG "network"
 
diff --git a/qthing/network/network_animation.cpp b/qthing/network/network_animation.cpp
index 0c17f0d..de91dbc 100644
--- a/qthing/network/network_animation.cpp
+++ b/qthing/network/network_animation.cpp
@@ -1,8 +1,8 @@
-#import <algorithm>
-#import <vector>
+#include <algorithm>
+#include <vector>
 
-#import "led_strip.hpp"
-#import "qthing_legacy.hpp"
+#include "qthing/led_strip.hpp"
+#include "qthing/qthing_legacy.hpp"
 
 // void addUDPPacketCallback(std::string magicString, udpPacketCallback
 // callback);
diff --git a/qthing/network/udp.cpp b/qthing/network/udp.cpp
index 6c8a1df..0c9a227 100644
--- a/qthing/network/udp.cpp
+++ b/qthing/network/udp.cpp
@@ -6,7 +6,7 @@
 #include "lwip/err.h"
 #include "lwip/sockets.h"
 #include "lwip/sys.h"
-#include "qthing_legacy.hpp"
+#include "qthing/qthing_legacy.hpp"
 
 static const char* TAG = "udp-server";
 
diff --git a/qthing/network/wifi.cpp b/qthing/network/wifi.cpp
index 36a6a06..bccfc64 100644
--- a/qthing/network/wifi.cpp
+++ b/qthing/network/wifi.cpp
@@ -5,15 +5,15 @@
 #include "esp_event_loop.h"
 #include "esp_log.h"
 #include "esp_wifi.h"
-#include "event.hpp"
+#include "qthing/event.hpp"
 #include "freertos/FreeRTOS.h"
 #include "freertos/event_groups.h"
 #include "freertos/task.h"
-#include "io.hpp"
-#include "mqtt.hpp"
-#include "network.hpp"
+#include "qthing/io.hpp"
+#include "qthing/mqtt.hpp"
+#include "qthing/network.hpp"
 #include "nvs_flash.h"
-#include "qthing_legacy.hpp"
+#include "qthing/qthing_legacy.hpp"
 #include "string.h"
 
 namespace qthing {
diff --git a/qthing/ntp.cpp b/qthing/ntp.cpp
index 5fe9ae6..917c294 100644
--- a/qthing/ntp.cpp
+++ b/qthing/ntp.cpp
@@ -8,7 +8,7 @@
 #include "apps/sntp/sntp.h"
 #include "esp_log.h"
 #include "freertos/task.h"
-#include "qthing_legacy.hpp"
+#include "qthing/qthing_legacy.hpp"
 
 #define TAG "NTP"
 
diff --git a/qthing/oled.cpp b/qthing/oled.cpp
index e1b0922..4ba182c 100644
--- a/qthing/oled.cpp
+++ b/qthing/oled.cpp
@@ -2,10 +2,10 @@
 
 #include "Arduino.h"
 #include "SSD1306Wire.h"
-#include "event.hpp"
-#include "network.hpp"
-#include "oled_symbols.hpp"
-#include "qthing_legacy.hpp"
+#include "qthing/event.hpp"
+#include "qthing/network.hpp"
+#include "qthing/oled_symbols.hpp"
+#include "qthing/qthing_legacy.hpp"
 
 namespace qthing {
 
diff --git a/qthing/peripherals/button_panel_5x5.cpp b/qthing/peripherals/button_panel_5x5.cpp
index c8d902c..003a23c 100644
--- a/qthing/peripherals/button_panel_5x5.cpp
+++ b/qthing/peripherals/button_panel_5x5.cpp
@@ -6,8 +6,8 @@
 #include <array>
 #include <functional>
 
-#include "io.hpp"
-#include "qthing_legacy.hpp"
+#include "qthing/io.hpp"
+#include "qthing/qthing_legacy.hpp"
 
 #define TAG "button_panel"
 
diff --git a/qthing/peripherals/led_strip.cpp b/qthing/peripherals/led_strip.cpp
index 5e35ada..bf85149 100644
--- a/qthing/peripherals/led_strip.cpp
+++ b/qthing/peripherals/led_strip.cpp
@@ -1,9 +1,9 @@
-#include "led_strip.hpp"
+#include "qthing/led_strip.hpp"
 
 #include <algorithm>
 
-#include "power.hpp"
-#include "qthing_legacy.hpp"
+#include "qthing/power.hpp"
+#include "qthing/qthing_legacy.hpp"
 
 using namespace qthing;
 
diff --git a/qthing/rc_433.cpp b/qthing/rc_433.cpp
index 769b07f..1aabff1 100644
--- a/qthing/rc_433.cpp
+++ b/qthing/rc_433.cpp
@@ -1,4 +1,4 @@
-#include "rc_433.hpp"
+#include "qthing/rc_433.hpp"
 
 #include <RCSwitch.h>
 
@@ -6,7 +6,7 @@
 
 #include "Arduino.h"
 #include "esp_log.h"
-#include "mqtt.hpp"
+#include "qthing/mqtt.hpp"
 
 #define RC_TAG "RC_433"
 
diff --git a/qthing/sensor.cpp b/qthing/sensor.cpp
index ed1cd7d..47207dd 100644
--- a/qthing/sensor.cpp
+++ b/qthing/sensor.cpp
@@ -5,9 +5,9 @@
 #include "esp_log.h"
 #include "freertos/FreeRTOS.h"
 #include "freertos/task.h"
-#include "mqtt.hpp"
-#include "polyfill.hpp"
-#include "qthing_legacy.hpp"
+#include "qthing/mqtt.hpp"
+#include "qthing/polyfill.hpp"
+#include "qthing/qthing_legacy.hpp"
 
 #define SLEEP_PERIOD 60 * 1000 / portTICK_PERIOD_MS
 
diff --git a/qthing/status.cpp b/qthing/status.cpp
index aa1febf..67a05bd 100644
--- a/qthing/status.cpp
+++ b/qthing/status.cpp
@@ -2,9 +2,9 @@
 #include "esp_log.h"
 #include "freertos/FreeRTOS.h"
 #include "freertos/task.h"
-#include "io.hpp"
-#include "network.hpp"
-#include "qthing_legacy.hpp"
+#include "qthing/io.hpp"
+#include "qthing/network.hpp"
+#include "qthing/qthing_legacy.hpp"
 
 namespace qthing {
 
diff --git a/qthing/system/power.cpp b/qthing/system/power.cpp
index 17a0a5c..5f14ee7 100644
--- a/qthing/system/power.cpp
+++ b/qthing/system/power.cpp
@@ -1,9 +1,9 @@
-#include "power.hpp"
+#include "qthing/power.hpp"
 
 #include "esp_pm.h"
 #include "freertos/FreeRTOS.h"
 #include "freertos/task.h"
-#include "qthing_legacy.hpp"
+#include "qthing/qthing_legacy.hpp"
 
 // Power state guard
 static bool max_power = false;
diff --git a/qthing/system/time.cpp b/qthing/system/time.cpp
index 1d84af8..6584cd0 100644
--- a/qthing/system/time.cpp
+++ b/qthing/system/time.cpp
@@ -1,4 +1,4 @@
-#include "time.hpp"
+#include "qthing/time.hpp"
 
 bool qthing::get_localtime(tm& result) {
   time_t now = time(NULL);
diff --git a/qthing/util.cpp b/qthing/util.cpp
index 10e1cdb..f791d35 100644
--- a/qthing/util.cpp
+++ b/qthing/util.cpp
@@ -1,11 +1,11 @@
-#include "util.hpp"
+#include "qthing/util.hpp"
 
 #include <sstream>
 
 #include "freertos/FreeRTOS.h"
 #include "freertos/task.h"
 #include "lwip/sockets.h"
-#include "qthing_legacy.hpp"
+#include "qthing/qthing_legacy.hpp"
 
 unsigned long IRAM_ATTR qthing::millis() { return xTaskGetTickCount() * portTICK_PERIOD_MS; }
 
-- 
GitLab