From 8e249636054f62defa51f262b8beb954e07ed6dc Mon Sep 17 00:00:00 2001 From: KlausMu Date: Tue, 16 Apr 2024 14:21:16 +0200 Subject: [PATCH] introduction of "device_pool" --- Platformio/platformio.ini | 2 + .../device_denonAvr/device_denonAvr.cpp | 0 .../device_denonAvr/device_denonAvr.h | 0 .../device_lgsoundbar/device_lgsoundbar.cpp | 0 .../device_lgsoundbar/device_lgsoundbar.h | 0 Platformio/src/devices_pool/README | 8 ++++ .../TV/device_lgTV/device_lgTV.cpp | 0 .../TV/device_lgTV/device_lgTV.h | 0 .../device_lgbluray/device_lgbluray.cpp | 0 .../device_lgbluray/device_lgbluray.h | 0 .../device_samsungbluray.cpp | 0 .../device_samsungbluray.h | 0 .../device_shield/device_shield.cpp | 0 .../mediaPlayer/device_shield/device_shield.h | 0 Platformio/src/main.cpp | 45 ++++++++++++------- 15 files changed, 38 insertions(+), 17 deletions(-) rename Platformio/src/{devices => devices_pool}/AVreceiver/device_denonAvr/device_denonAvr.cpp (100%) rename Platformio/src/{devices => devices_pool}/AVreceiver/device_denonAvr/device_denonAvr.h (100%) rename Platformio/src/{devices => devices_pool}/AVreceiver/device_lgsoundbar/device_lgsoundbar.cpp (100%) rename Platformio/src/{devices => devices_pool}/AVreceiver/device_lgsoundbar/device_lgsoundbar.h (100%) create mode 100644 Platformio/src/devices_pool/README rename Platformio/src/{devices => devices_pool}/TV/device_lgTV/device_lgTV.cpp (100%) rename Platformio/src/{devices => devices_pool}/TV/device_lgTV/device_lgTV.h (100%) rename Platformio/src/{devices => devices_pool}/mediaPlayer/device_lgbluray/device_lgbluray.cpp (100%) rename Platformio/src/{devices => devices_pool}/mediaPlayer/device_lgbluray/device_lgbluray.h (100%) rename Platformio/src/{devices => devices_pool}/mediaPlayer/device_samsungbluray/device_samsungbluray.cpp (100%) rename Platformio/src/{devices => devices_pool}/mediaPlayer/device_samsungbluray/device_samsungbluray.h (100%) rename Platformio/src/{devices => devices_pool}/mediaPlayer/device_shield/device_shield.cpp (100%) rename Platformio/src/{devices => devices_pool}/mediaPlayer/device_shield/device_shield.h (100%) diff --git a/Platformio/platformio.ini b/Platformio/platformio.ini index 28d7766..ecb78d9 100644 --- a/Platformio/platformio.ini +++ b/Platformio/platformio.ini @@ -147,6 +147,7 @@ build_src_filter = +<*> +<../hardware/ESP32/*> ;+<../hardware/ESP32/lib/ESP32-BLE-Keyboard/*> + - ; use this if you are using Ubuntu or WSL2 (64 bit compiler) [env:linux_64bit] @@ -178,6 +179,7 @@ build_flags = build_src_filter = +<*> +<../hardware/windows_linux/*> + - ; use this if you are using Windows MSYS2 MINGW64 (64 bit compiler) [env:windows_64bit] diff --git a/Platformio/src/devices/AVreceiver/device_denonAvr/device_denonAvr.cpp b/Platformio/src/devices_pool/AVreceiver/device_denonAvr/device_denonAvr.cpp similarity index 100% rename from Platformio/src/devices/AVreceiver/device_denonAvr/device_denonAvr.cpp rename to Platformio/src/devices_pool/AVreceiver/device_denonAvr/device_denonAvr.cpp diff --git a/Platformio/src/devices/AVreceiver/device_denonAvr/device_denonAvr.h b/Platformio/src/devices_pool/AVreceiver/device_denonAvr/device_denonAvr.h similarity index 100% rename from Platformio/src/devices/AVreceiver/device_denonAvr/device_denonAvr.h rename to Platformio/src/devices_pool/AVreceiver/device_denonAvr/device_denonAvr.h diff --git a/Platformio/src/devices/AVreceiver/device_lgsoundbar/device_lgsoundbar.cpp b/Platformio/src/devices_pool/AVreceiver/device_lgsoundbar/device_lgsoundbar.cpp similarity index 100% rename from Platformio/src/devices/AVreceiver/device_lgsoundbar/device_lgsoundbar.cpp rename to Platformio/src/devices_pool/AVreceiver/device_lgsoundbar/device_lgsoundbar.cpp diff --git a/Platformio/src/devices/AVreceiver/device_lgsoundbar/device_lgsoundbar.h b/Platformio/src/devices_pool/AVreceiver/device_lgsoundbar/device_lgsoundbar.h similarity index 100% rename from Platformio/src/devices/AVreceiver/device_lgsoundbar/device_lgsoundbar.h rename to Platformio/src/devices_pool/AVreceiver/device_lgsoundbar/device_lgsoundbar.h diff --git a/Platformio/src/devices_pool/README b/Platformio/src/devices_pool/README new file mode 100644 index 0000000..4cebe0b --- /dev/null +++ b/Platformio/src/devices_pool/README @@ -0,0 +1,8 @@ + +This directory is intended for a pool of devices already contributed by the community of OMOTE. +Files in this directory won't get compiled by default. + +If you want to use one of these devices, then +- copy the corresponding device folder from "/src/devices_pool/..." to "/src/devices/..." +- add the corresponding call to "register_device_*()" into 'src/main.cpp' (and include the device header file in "src/mail.cpp" as well) +- start using the commands defined by the device, e.g. by putting them in the hardware key map of "scene__default.cpp" or of a specific scene diff --git a/Platformio/src/devices/TV/device_lgTV/device_lgTV.cpp b/Platformio/src/devices_pool/TV/device_lgTV/device_lgTV.cpp similarity index 100% rename from Platformio/src/devices/TV/device_lgTV/device_lgTV.cpp rename to Platformio/src/devices_pool/TV/device_lgTV/device_lgTV.cpp diff --git a/Platformio/src/devices/TV/device_lgTV/device_lgTV.h b/Platformio/src/devices_pool/TV/device_lgTV/device_lgTV.h similarity index 100% rename from Platformio/src/devices/TV/device_lgTV/device_lgTV.h rename to Platformio/src/devices_pool/TV/device_lgTV/device_lgTV.h diff --git a/Platformio/src/devices/mediaPlayer/device_lgbluray/device_lgbluray.cpp b/Platformio/src/devices_pool/mediaPlayer/device_lgbluray/device_lgbluray.cpp similarity index 100% rename from Platformio/src/devices/mediaPlayer/device_lgbluray/device_lgbluray.cpp rename to Platformio/src/devices_pool/mediaPlayer/device_lgbluray/device_lgbluray.cpp diff --git a/Platformio/src/devices/mediaPlayer/device_lgbluray/device_lgbluray.h b/Platformio/src/devices_pool/mediaPlayer/device_lgbluray/device_lgbluray.h similarity index 100% rename from Platformio/src/devices/mediaPlayer/device_lgbluray/device_lgbluray.h rename to Platformio/src/devices_pool/mediaPlayer/device_lgbluray/device_lgbluray.h diff --git a/Platformio/src/devices/mediaPlayer/device_samsungbluray/device_samsungbluray.cpp b/Platformio/src/devices_pool/mediaPlayer/device_samsungbluray/device_samsungbluray.cpp similarity index 100% rename from Platformio/src/devices/mediaPlayer/device_samsungbluray/device_samsungbluray.cpp rename to Platformio/src/devices_pool/mediaPlayer/device_samsungbluray/device_samsungbluray.cpp diff --git a/Platformio/src/devices/mediaPlayer/device_samsungbluray/device_samsungbluray.h b/Platformio/src/devices_pool/mediaPlayer/device_samsungbluray/device_samsungbluray.h similarity index 100% rename from Platformio/src/devices/mediaPlayer/device_samsungbluray/device_samsungbluray.h rename to Platformio/src/devices_pool/mediaPlayer/device_samsungbluray/device_samsungbluray.h diff --git a/Platformio/src/devices/mediaPlayer/device_shield/device_shield.cpp b/Platformio/src/devices_pool/mediaPlayer/device_shield/device_shield.cpp similarity index 100% rename from Platformio/src/devices/mediaPlayer/device_shield/device_shield.cpp rename to Platformio/src/devices_pool/mediaPlayer/device_shield/device_shield.cpp diff --git a/Platformio/src/devices/mediaPlayer/device_shield/device_shield.h b/Platformio/src/devices_pool/mediaPlayer/device_shield/device_shield.h similarity index 100% rename from Platformio/src/devices/mediaPlayer/device_shield/device_shield.h rename to Platformio/src/devices_pool/mediaPlayer/device_shield/device_shield.h diff --git a/Platformio/src/main.cpp b/Platformio/src/main.cpp index 58ff57a..0515123 100644 --- a/Platformio/src/main.cpp +++ b/Platformio/src/main.cpp @@ -4,20 +4,26 @@ // init hardware and hardware loop #include "applicationInternal/hardware/hardwarePresenter.h" // register devices and their commands +// special #include "devices/misc/device_specialCommands.h" -#include "devices/TV/device_samsungTV/device_samsungTV.h" -#include "devices/TV/device_lgTV/device_lgTV.h" -#include "devices/mediaPlayer/device_shield/device_shield.h" -#include "devices/AVreceiver/device_lgsoundbar/device_lgsoundbar.h" -#include "devices/mediaPlayer/device_lgbluray/device_lgbluray.h" -#include "devices/mediaPlayer/device_samsungbluray/device_samsungbluray.h" -#include "devices/AVreceiver/device_yamahaAmp/device_yamahaAmp.h" -#include "devices/AVreceiver/device_denonAvr/device_denonAvr.h" -#include "devices/mediaPlayer/device_appleTV/device_appleTV.h" +#include "applicationInternal/commandHandler.h" +// keyboards #include "devices/keyboard/device_keyboard_mqtt/device_keyboard_mqtt.h" #include "devices/keyboard/device_keyboard_ble/device_keyboard_ble.h" +// TV +#include "devices/TV/device_samsungTV/device_samsungTV.h" +//#include "devices/TV/device_lgTV/device_lgTV.h" +// AV receiver +#include "devices/AVreceiver/device_yamahaAmp/device_yamahaAmp.h" +//#include "devices/AVreceiver/device_denonAvr/device_denonAvr.h" +//#include "devices/AVreceiver/device_lgsoundbar/device_lgsoundbar.h" +// media player +#include "devices/mediaPlayer/device_appleTV/device_appleTV.h" +//#include "devices/mediaPlayer/device_lgbluray/device_lgbluray.h" +//#include "devices/mediaPlayer/device_samsungbluray/device_samsungbluray.h" +//#include "devices/mediaPlayer/device_shield/device_shield.h" +// misc #include "devices/misc/device_smarthome/device_smarthome.h" -#include "applicationInternal/commandHandler.h" // register gui and keys #include "applicationInternal/gui/guiBase.h" #include "applicationInternal/gui/guiRegistry.h" @@ -73,16 +79,21 @@ int main(int argc, char *argv[]) { // register commands for the devices register_specialCommands(); + // TV register_device_samsungTV(); +// register_device_lgTV(); + // AV receiver register_device_yamahaAmp(); - register_device_denonAvr(); - register_device_smarthome(); + //register_device_denonAvr(); + //register_device_lgsoundbar(); + // media player register_device_appleTV(); - register_device_lgTV(); - register_device_lgsoundbar(); - register_device_lgbluray(); - register_device_samsungbluray(); - register_device_shield(); + //register_device_lgbluray(); + //register_device_samsungbluray(); + //register_device_shield(); + // misc + register_device_smarthome(); + #if (ENABLE_KEYBOARD_MQTT == 1) register_device_keyboard_mqtt(); #endif