Skip to content

Commit

Permalink
TimerService implemented to control display on/off state, as well as …
Browse files Browse the repository at this point in the history
…brightness. Note, brightness change will only work, if the automatic brightness adjustment is disabled.

#203
  • Loading branch information
BlueAndi committed Dec 29, 2024
1 parent a107e44 commit 3471380
Show file tree
Hide file tree
Showing 56 changed files with 1,895 additions and 262 deletions.
1 change: 1 addition & 0 deletions config/configNormal.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ lib_deps =
TopicHandlerService @ ~0.1.0 # Mandatory, can not be removed.
FileMgrService @ ~0.1.0 # Mandatory, can not be removed.
AudioService @ ~0.1.0
TimerService @ ~0.1.0
# ********** Topic handlers **********
RestApiTopicHandler @ ~0.1.0 # Mandatory, can not be removed. Used by webinterface.
MqttApiTopicHandler @ ~0.1.0 # Requires MqttService
Expand Down
1 change: 1 addition & 0 deletions config/configSmall.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ lib_deps =
TopicHandlerService @ ~0.1.0 # Mandatory, can not be removed.
FileMgrService @ ~0.1.0 # Mandatory, can not be removed.
;AudioService @ ~0.1.0
;TimerService @ ~0.1.0
# ********** Topic handlers **********
RestApiTopicHandler @ ~0.1.0 # Mandatory, can not be removed. Used by webinterface.
;MqttApiTopicHandler @ ~0.1.0 # Requires MqttService
Expand Down
1 change: 1 addition & 0 deletions config/configSmallNoI2s.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ lib_deps =
TopicHandlerService @ ~0.1.0 # Mandatory, can not be removed.
FileMgrService @ ~0.1.0 # Mandatory, can not be removed.
;AudioService @ ~0.1.0
;TimerService @ ~0.1.0
# ********** Topic handlers **********
RestApiTopicHandler @ ~0.1.0 # Mandatory, can not be removed. Used by webinterface.
;MqttApiTopicHandler @ ~0.1.0 # Requires MqttService
Expand Down
1 change: 1 addition & 0 deletions config/configSmallUlanzi.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ lib_deps =
TopicHandlerService @ ~0.1.0 # Mandatory, can not be removed.
FileMgrService @ ~0.1.0 # Mandatory, can not be removed.
;AudioService @ ~0.1.0
;TimerService @ ~0.1.0
# ********** Topic handlers **********
RestApiTopicHandler @ ~0.1.0 # Mandatory, can not be removed. Used by webinterface.
MqttApiTopicHandler @ ~0.1.0 # Requires MqttService
Expand Down
1 change: 1 addition & 0 deletions config/configTiny.ini
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ lib_deps =
;MqttService @ ~0.1.0
TopicHandlerService @ ~0.1.0 # Mandatory, can not be removed.
;AudioService @ ~0.1.0
;TimerService @ ~0.1.0
# ********** Topic handlers **********
RestApiTopicHandler @ ~0.1.0 # Mandatory, can not be removed. Used by webinterface.
;MqttApiTopicHandler @ ~0.1.0 # Requires MqttService
Expand Down
2 changes: 2 additions & 0 deletions data/debug.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ <h1 class="mt-5">Debug</h1>
<!-- Pixelix menu -->
<script type="text/javascript" src="/js/menu.js"></script>
<script type="text/javascript" src="/js/pluginsSubMenu.js"></script>
<script type="text/javascript" src="/js/servicesSubMenu.js"></script>
<!-- Pixelix utilities -->
<script type="text/javascript" src="/js/dialog.js"></script>

Expand Down Expand Up @@ -301,6 +302,7 @@ <h1 class="mt-5">Debug</h1>
/* Execute after page is ready. */
$(document).ready(function() {
menu.addSubMenu(menu.data, "Plugins", pluginSubMenu);
menu.addSubMenu(menu.data, "Services", serviceSubMenu);
menu.create("menu", menu.data);

$("#buttonInfo").click(function(e) {
Expand Down
2 changes: 2 additions & 0 deletions data/display.html
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ <h1 class="mt-5">Display</h1>
<!-- Pixelix menu -->
<script type="text/javascript" src="/js/menu.js"></script>
<script type="text/javascript" src="/js/pluginsSubMenu.js"></script>
<script type="text/javascript" src="/js/servicesSubMenu.js"></script>
<!-- Pixelix utilities -->
<script type="text/javascript" src="/js/dialog.js"></script>
<!-- Pixelix drag'n drop -->
Expand Down Expand Up @@ -769,6 +770,7 @@ <h1 class="mt-5">Display</h1>
ctx = displayCanvas.getContext("2d");

menu.addSubMenu(menu.data, "Plugins", pluginSubMenu);
menu.addSubMenu(menu.data, "Services", serviceSubMenu);
menu.create("menu", menu.data);

/* Connect to pixelix */
Expand Down
2 changes: 2 additions & 0 deletions data/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ <h2>Files</h2>
<!-- Pixelix menu -->
<script type="text/javascript" src="/js/menu.js"></script>
<script type="text/javascript" src="/js/pluginsSubMenu.js"></script>
<script type="text/javascript" src="/js/servicesSubMenu.js"></script>
<!-- Pixelix utilities -->
<script type="text/javascript" src="/js/utils.js"></script>
<script type="text/javascript" src="/js/dialog.js"></script>
Expand Down Expand Up @@ -391,6 +392,7 @@ <h2>Files</h2>

$(document).ready(function() {
menu.addSubMenu(menu.data, "Plugins", pluginSubMenu);
menu.addSubMenu(menu.data, "Services", serviceSubMenu);
menu.create("menu", menu.data);

$("#uploadFile").on("change", function() {
Expand Down
2 changes: 2 additions & 0 deletions data/error.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@ <h1 class="mt-5">Error</h1>
<!-- Pixelix menu -->
<script type="text/javascript" src="/js/menu.js"></script>
<script type="text/javascript" src="/js/pluginsSubMenu.js"></script>
<script type="text/javascript" src="/js/servicesSubMenu.js"></script>

<script>
$(document).ready(function() {
menu.addSubMenu(menu.data, "Plugins", pluginSubMenu);
menu.addSubMenu(menu.data, "Services", serviceSubMenu);
menu.create("menu", menu.data);
});
</script>
Expand Down
2 changes: 2 additions & 0 deletions data/icons.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ <h2>Overview</h2>
<!-- Pixelix menu -->
<script type="text/javascript" src="/js/menu.js"></script>
<script type="text/javascript" src="/js/pluginsSubMenu.js"></script>
<script type="text/javascript" src="/js/servicesSubMenu.js"></script>
<!-- Pixelix utilities -->
<script type="text/javascript" src="/js/utils.js"></script>
<script type="text/javascript" src="/js/dialog.js"></script>
Expand Down Expand Up @@ -226,6 +227,7 @@ <h2>Overview</h2>

$(document).ready(function() {
menu.addSubMenu(menu.data, "Plugins", pluginSubMenu);
menu.addSubMenu(menu.data, "Services", serviceSubMenu);
menu.create("menu", menu.data);

downloadFileList("overview");
Expand Down
2 changes: 2 additions & 0 deletions data/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ <h1 class="mt-5">Welcome to</h1>
<!-- Pixelix menu -->
<script type="text/javascript" src="/js/menu.js"></script>
<script type="text/javascript" src="/js/pluginsSubMenu.js"></script>
<script type="text/javascript" src="/js/servicesSubMenu.js"></script>

<script>
$(document).ready(function() {
menu.addSubMenu(menu.data, "Plugins", pluginSubMenu);
menu.addSubMenu(menu.data, "Services", serviceSubMenu);
menu.create("menu", menu.data);
});
</script>
Expand Down
2 changes: 2 additions & 0 deletions data/info.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ <h2>Filesystem</h2>
<!-- Pixelix menu -->
<script type="text/javascript" src="/js/menu.js"></script>
<script type="text/javascript" src="/js/pluginsSubMenu.js"></script>
<script type="text/javascript" src="/js/servicesSubMenu.js"></script>
<!-- chart.js -->
<script type="text/javascript" src="/js/rpie.js"></script>

Expand Down Expand Up @@ -307,6 +308,7 @@ <h2>Filesystem</h2>

$(document).ready(function() {
menu.addSubMenu(menu.data, "Plugins", pluginSubMenu);
menu.addSubMenu(menu.data, "Services", serviceSubMenu);
menu.create("menu", menu.data);

/* Draw the chart, showing the current situation on the heap. */
Expand Down
4 changes: 4 additions & 0 deletions data/js/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ menu.data = [{
}, {
"title": "Icons",
"hyperRef": "/icons.html"
}, {
"title": "Services",
"hyperRef": "#",
"subMenu": []
}, {
"title": "Settings",
"hyperRef": "/settings.html"
Expand Down
2 changes: 2 additions & 0 deletions data/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ <h1 class="mt-5">Settings</h1>
<!-- Pixelix menu -->
<script type="text/javascript" src="/js/menu.js"></script>
<script type="text/javascript" src="/js/pluginsSubMenu.js"></script>
<script type="text/javascript" src="/js/servicesSubMenu.js"></script>
<!-- Pixelix utilities -->
<script type="text/javascript" src="/js/utils.js"></script>
<script type="text/javascript" src="/js/dialog.js"></script>
Expand Down Expand Up @@ -101,6 +102,7 @@ <h1 class="mt-5">Settings</h1>
var index = 0;

menu.addSubMenu(menu.data, "Plugins", pluginSubMenu);
menu.addSubMenu(menu.data, "Services", serviceSubMenu);
menu.create("menu", menu.data);

restClient.getSettingKeys().then(function(result) {
Expand Down
2 changes: 2 additions & 0 deletions data/update.html
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ <h1 class="mt-5">Update</h1>
<!-- Pixelix menu -->
<script type="text/javascript" src="/js/menu.js"></script>
<script type="text/javascript" src="/js/pluginsSubMenu.js"></script>
<script type="text/javascript" src="/js/servicesSubMenu.js"></script>
<!-- Pixelix utilities -->
<script type="text/javascript" src="/js/utils.js"></script>
<script type="text/javascript" src="/js/dialog.js"></script>
Expand Down Expand Up @@ -358,6 +359,7 @@ <h1 class="mt-5">Update</h1>
/* Execute after page is ready. */
$(document).ready(function() {
menu.addSubMenu(menu.data, "Plugins", pluginSubMenu);
menu.addSubMenu(menu.data, "Services", serviceSubMenu);
menu.create("menu", menu.data);

$("#inputFile").on("change", function() {
Expand Down
12 changes: 6 additions & 6 deletions include/PluginList.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ namespace PluginList
*/
typedef struct
{
const char* name; /**< Name of plugin type. */
IPluginMaintenance::CreateFunc createFunc; /**< Plugin creation function */
const char* name; /**< Name of plugin type. */
IPluginMaintenance::CreateFunc createFunc; /**< Plugin creation function */

} Element;

Expand All @@ -73,15 +73,15 @@ typedef struct

/**
* Get list of provided plugins and their creation function.
*
*
* @param[out] length Length of list.
*
*
* @return List of plugins.
*/
const Element* getList(uint8_t& length);

};
}; /* namespace PluginList */

#endif /* PLUGIN_LIST_HPP */
#endif /* PLUGIN_LIST_HPP */

/** @} */
26 changes: 22 additions & 4 deletions include/Services.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
/**
* @brief Services
* @author Andreas Merkle <[email protected]>
*
*
* @addtogroup service
*
* @{
Expand Down Expand Up @@ -59,13 +59,22 @@ namespace Services
* Types and Classes
*****************************************************************************/

/**
* Service list element.
*/
typedef struct
{
const char* name; /**< Name of service. */

} Element;

/******************************************************************************
* Functions
*****************************************************************************/

/**
* Start all services.
*
*
* @return If successful started, it will return true otherwise false.
*/
extern bool startAll();
Expand All @@ -80,8 +89,17 @@ extern void stopAll();
*/
extern void processAll();

}
/**
* Get list of provided plugins and their creation function.
*
* @param[out] length Length of list.
*
* @return List of plugins.
*/
const Element* getList(uint8_t& length);

} /* namespace Services */

#endif /* SERVICES_H */
#endif /* SERVICES_H */

/** @} */
2 changes: 2 additions & 0 deletions lib/BTCQuotePlugin/web/BTCQuotePlugin.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,12 @@ <h2>REST API</h2>
<!-- Pixelix menu -->
<script type="text/javascript" src="/js/menu.js"></script>
<script type="text/javascript" src="/js/pluginsSubMenu.js"></script>
<script type="text/javascript" src="/js/servicesSubMenu.js"></script>

<script>
$(document).ready(function() {
menu.addSubMenu(menu.data, "Plugins", pluginSubMenu);
menu.addSubMenu(menu.data, "Services", serviceSubMenu);
menu.create("menu", menu.data);
});
</script>
Expand Down
2 changes: 2 additions & 0 deletions lib/BatteryPlugin/web/BatteryPlugin.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ <h2>REST API</h2>
<!-- Pixelix menu -->
<script type="text/javascript" src="/js/menu.js"></script>
<script type="text/javascript" src="/js/pluginsSubMenu.js"></script>
<script type="text/javascript" src="/js/servicesSubMenu.js"></script>

<script>
$(document).ready(function() {
menu.addSubMenu(menu.data, "Plugins", pluginSubMenu);
menu.addSubMenu(menu.data, "Services", serviceSubMenu);
menu.create("menu", menu.data);
});
</script>
Expand Down
2 changes: 2 additions & 0 deletions lib/CountdownPlugin/web/CountdownPlugin.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ <h3>Target Date</h3>
<!-- Pixelix menu -->
<script type="text/javascript" src="/js/menu.js"></script>
<script type="text/javascript" src="/js/pluginsSubMenu.js"></script>
<script type="text/javascript" src="/js/servicesSubMenu.js"></script>
<!-- Pixelix utilities -->
<script type="text/javascript" src="/js/utils.js"></script>
<!-- Pixelix REST API -->
Expand Down Expand Up @@ -198,6 +199,7 @@ <h3>Target Date</h3>

$(document).ready(function() {
menu.addSubMenu(menu.data, "Plugins", pluginSubMenu);
menu.addSubMenu(menu.data, "Services", serviceSubMenu);
menu.create("menu", menu.data);

utils.injectOrigin("injectOrigin", "{{ORIGIN}}");
Expand Down
2 changes: 2 additions & 0 deletions lib/DDPPlugin/web/DDPPlugin.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,12 @@ <h2>REST API</h2>
<!-- Pixelix menu -->
<script type="text/javascript" src="/js/menu.js"></script>
<script type="text/javascript" src="/js/pluginsSubMenu.js"></script>
<script type="text/javascript" src="/js/servicesSubMenu.js"></script>

<script>
$(document).ready(function() {
menu.addSubMenu(menu.data, "Plugins", pluginSubMenu);
menu.addSubMenu(menu.data, "Services", serviceSubMenu);
menu.create("menu", menu.data);
});
</script>
Expand Down
2 changes: 2 additions & 0 deletions lib/DateTimePlugin/web/DateTimePlugin.html
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ <h3>Display</h3>
<!-- Pixelix menu -->
<script type="text/javascript" src="/js/menu.js"></script>
<script type="text/javascript" src="/js/pluginsSubMenu.js"></script>
<script type="text/javascript" src="/js/servicesSubMenu.js"></script>
<!-- Pixelix utilities -->
<script type="text/javascript" src="/js/utils.js"></script>
<!-- Pixelix REST API -->
Expand Down Expand Up @@ -350,6 +351,7 @@ <h3>Display</h3>

$(document).ready(function() {
menu.addSubMenu(menu.data, "Plugins", pluginSubMenu);
menu.addSubMenu(menu.data, "Services", serviceSubMenu);
menu.create("menu", menu.data);

utils.injectOrigin("injectOrigin", "{{ORIGIN}}");
Expand Down
2 changes: 2 additions & 0 deletions lib/FirePlugin/web/FirePlugin.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ <h2>REST API</h2>
<!-- Pixelix menu -->
<script type="text/javascript" src="/js/menu.js"></script>
<script type="text/javascript" src="/js/pluginsSubMenu.js"></script>
<script type="text/javascript" src="/js/servicesSubMenu.js"></script>

<script>
$(document).ready(function() {
menu.addSubMenu(menu.data, "Plugins", pluginSubMenu);
menu.addSubMenu(menu.data, "Services", serviceSubMenu);
menu.create("menu", menu.data);
});
</script>
Expand Down
2 changes: 2 additions & 0 deletions lib/GameOfLifePlugin/web/GameOfLifePlugin.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@ <h2>REST API</h2>
<!-- Pixelix menu -->
<script type="text/javascript" src="/js/menu.js"></script>
<script type="text/javascript" src="/js/pluginsSubMenu.js"></script>
<script type="text/javascript" src="/js/servicesSubMenu.js"></script>

<script>
$(document).ready(function() {
menu.addSubMenu(menu.data, "Plugins", pluginSubMenu);
menu.addSubMenu(menu.data, "Services", serviceSubMenu);
menu.create("menu", menu.data);
});
</script>
Expand Down
2 changes: 2 additions & 0 deletions lib/GrabViaMqttPlugin/web/GrabViaMqttPlugin.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ <h3>User</h3>
<!-- Pixelix menu -->
<script type="text/javascript" src="/js/menu.js"></script>
<script type="text/javascript" src="/js/pluginsSubMenu.js"></script>
<script type="text/javascript" src="/js/servicesSubMenu.js"></script>
<!-- Pixelix utilities -->
<script type="text/javascript" src="/js/utils.js"></script>
<!-- Pixelix REST API -->
Expand Down Expand Up @@ -224,6 +225,7 @@ <h3>User</h3>

$(document).ready(function() {
menu.addSubMenu(menu.data, "Plugins", pluginSubMenu);
menu.addSubMenu(menu.data, "Services", serviceSubMenu);
menu.create("menu", menu.data);

utils.injectOrigin("injectOrigin", "{{ORIGIN}}");
Expand Down
Loading

0 comments on commit 3471380

Please sign in to comment.