LSH-Core
A robust C++ framework for Arduino-based home automation nodes
Loading...
Searching...
No Matches
configurator.hpp
Go to the documentation of this file.
1
21#ifndef LSHCORE_CONFIG_CONFIGURATOR_HPP
22#define LSHCORE_CONFIG_CONFIGURATOR_HPP
23
24#include <stdint.h>
26
27// Forward declarations
28class Actuator;
29class Clickable;
30class Indicator;
31
37{
38private:
39 // Helper functions for leaner config
40 static void addActuator(Actuator *actuator); // Helper to add an actuator, for leaner config.
41 static void addClickable(Clickable *clickable); // Helper to add a clickable, for leaner config.
42 static void addIndicator(Indicator *indicator); // Helper to add an indicator, for leaner config.
43
44 static auto getIndex(const Actuator &actuator) -> uint8_t; // Helper to get an actuator index, for leaner config
45 static auto getIndex(const Clickable &clickable) -> uint8_t; // Helper to get a clickable index, for leaner config
46 static auto getIndex(const Indicator &indicator) -> uint8_t; // Helper to get a indicator index, for leaner config
47
48#if defined(CONTROLLINO_MAXI) || defined(CONTROLLINO_MAXI_AUTOMATION) || defined(CONTROLLINO_MEGA)
49 static void disableRtc(); // Disable Controllino RTC
50 static void disableEth(); // Disable COntrollino Ethernet
51#endif
52
53public:
54 Configurator() = delete;
55 ~Configurator() = delete;
56
57 // Delete copy constructor, copy assignment operator, move constructor and move assignment operator
58#if (__cplusplus >= 201703L) && (__GNUC__ >= 7)
59 Configurator(const Configurator &) = delete;
60 Configurator(Configurator &&) = delete;
61 auto operator=(const Configurator &) -> Configurator & = delete;
62 auto operator=(Configurator &&) -> Configurator & = delete;
63#endif // (__cplusplus >= 201703L) && (__GNUC__ >= 7)
64
71 static void configure();
72 static void finalizeSetup(); // Final steps of configuration, must be called after configuration()
73};
74
75#endif // LSHCORE_CONFIG_CONFIGURATOR_HPP
Represents an actuator (relay) attached to a digital pin.
Definition actuator.hpp:33
A class that represents a clickable object, like a button, and its associated logic.
Definition clickable.hpp:37
"static class" used to configure the device.
Definition configurator.hpp:37
static void configure()
The main user-defined device configuration function.
static void finalizeSetup()
Final steps of configuration, must be called after configuration().
Definition configurator.cpp:98
Represents a state indicator for one or more attached actuators, indicators are normally connected to...
Definition indicator.hpp:35
Internal bridge that imports user-defined macros into the library's scope.