13#include "src/system/component/time_handling.h"
47 static constexpr uint8_t maxDataSize = 8;
49 Type get_type()
const {
return _type; }
329 std::array<uint8_t, maxDataSize> _data;
Define a command destined to the user layer. Command can only be created by the static make_* methods...
Definition: user_commands.h:21
bool parse_set_favorite_command(uint8_t &index) const
Parse the current command for a set favorite.
Definition: user_commands.cpp:341
static UserCommand make_set_mode_command(const uint8_t groupId, const uint8_t modeId)
Set this commant to handle mode switch.
Definition: user_commands.cpp:41
bool parse_blip_output_command(uint32_t &duration_ms) const
Parse the current command for an output blip.
Definition: user_commands.cpp:394
static UserCommand make_set_mic_sensitivity_command(const uint8_t sensitivity)
Set this command to set the microphone sensitivity.
Definition: user_commands.cpp:185
static UserCommand make_signal_sunrise_progress_command(const float progress)
Set this commant to signal a sunrise update.
Definition: user_commands.cpp:152
static UserCommand make_blip_output_command(const uint32_t duration_ms)
Set this commant to blip the output.
Definition: user_commands.cpp:210
bool parse_set_sunset_to_time_command(component::time::RealTime &time) const
Parse the current command for a set sunset to time value.
Definition: user_commands.cpp:284
static UserCommand make_disable_sun_timer_command(const bool isSunrise)
Set this command to disable a sun timer. A disabled sunrise keeps the brightness it reached,...
Definition: user_commands.cpp:176
bool parse_set_mode(uint8_t &groupId, uint8_t &modeId) const
Parse the current command for a set_mode values.
Definition: user_commands.cpp:251
bool parse_signal_suntimer_cancel_command() const
Parse the current command for a suntimer cancel signal.
Definition: user_commands.cpp:371
bool parse_print_status_command() const
Parse the current command for a status print.
Definition: user_commands.cpp:402
bool parse_set_sunrise_to_time_command(component::time::RealTime &time) const
Parse the current command for a set sunrise to time value.
Definition: user_commands.cpp:300
bool parse_ramp(uint8_t &ramp) const
Parse the current command for a ramp value.
Definition: user_commands.cpp:228
bool parse_set_ble_mode_command(uint8_t &index) const
Parse the current command for a set current mode to BLE mode.
Definition: user_commands.cpp:325
static UserCommand make_set_ramp_command(const uint8_t ramp)
Set this commant to handle user ramp change.
Definition: user_commands.cpp:22
bool parse_signal_sunset_progress_command(float &progress) const
Parse the current command for a sunset update signal.
Definition: user_commands.cpp:349
static UserCommand make_set_sunset_to_time_command(const component::time::RealTime &time)
Set this commant to set sunset to real time.
Definition: user_commands.cpp:72
bool parse_go_to_favorite_command(uint8_t &index) const
Parse the current command for a go to favorite.
Definition: user_commands.cpp:333
Type
Command type.
Definition: user_commands.h:25
@ SetSunsetToTime
set the sunset to a target real time
@ SignalSunriseProgress
Signal a sunrise update event.
@ PrintStatus
Print the current mode, group, ramp, brightness and favorite state on one line.
@ SetRealTime
set the system real time
@ SetBleMode
switch to a target BLE mode
@ Invalid
invalid placeholder message
@ SetBleCustomColorMode
switch to BLE custom color mode
@ PrintFavorites
Print the favorite mode count.
@ SetFavoriteIndex
Set the current mode to the target favorite index.
@ DisableSunTimer
Disable the sunset or the sunrise timer.
@ Brightness
set brightness
@ BlipOutput
Turn off the output for a short time.
@ SetMicSensitivity
Set the microphone sensitivity.
@ SignalSunsetProgress
Signal a sunset update event.
@ SignalSuntimerCancel
Signal that a suntimer was canceled.
@ SetUserRamp
set the user ramp value
@ SetSunriseToTime
set the sunrise to a target real time
@ GoToFavoriteIndex
Go to the target favorite index.
static UserCommand make_set_favorite_command(const uint8_t index)
Set this commant to set favorite.
Definition: user_commands.cpp:127
static UserCommand make_set_real_time_command(const component::time::RealTime &time)
Set this commant to set system real time.
Definition: user_commands.cpp:60
bool parse_brightness(brightness_t &brightness) const
Parse the current command for a brightness value.
Definition: user_commands.cpp:236
static UserCommand make_print_favorites_command()
Set this commant to print the favorite modes infos.
Definition: user_commands.cpp:202
bool parse_turn_onoff(bool &shouldTurnOn) const
Parse the current command for a on/off value.
Definition: user_commands.cpp:260
static UserCommand make_signal_sunset_progress_command(const float progress)
Set this commant to signal a sunset update.
Definition: user_commands.cpp:136
bool parse_set_ble_custom_color_mode_command(uint32_t &color) const
Parse the current command for a set current mode to BLE custom color.
Definition: user_commands.cpp:316
UserCommand()
Protected constructor to prevent unallowed uses.
Definition: user_commands.cpp:20
bool parse_signal_sunrise_progress_command(float &progress) const
Parse the current command for a sunrise update signal.
Definition: user_commands.cpp:360
static UserCommand make_set_ble_mode_command(const uint8_t index)
Set this commant to set ble mode.
Definition: user_commands.cpp:109
bool parse_disable_sun_timer_command(bool &isSunrise) const
Parse the current command for a sun timer disable.
Definition: user_commands.cpp:378
static UserCommand make_brightness_command(const brightness_t brightness)
Set this commant to handle brightness.
Definition: user_commands.cpp:31
static UserCommand make_signal_suntimer_cancel_command()
Set this commant to signal a suntimer cancel event.
Definition: user_commands.cpp:168
static UserCommand make_print_status_command()
Set this commant to print the user status line.
Definition: user_commands.cpp:194
static UserCommand make_turn_onoff_command(const bool shouldTurnOn)
Set this commant to handle turn on/off.
Definition: user_commands.cpp:51
static UserCommand make_go_to_favorite_command(const uint8_t index)
Set this commant to go to the given favorite, if possible.
Definition: user_commands.cpp:118
bool parse_set_mic_sensitivity_command(uint8_t &sensitivity) const
Parse the current command for a microphone sensitivity change.
Definition: user_commands.cpp:386
bool parse_print_favorites_command() const
Parse the current command for a favorites print.
Definition: user_commands.cpp:404
static UserCommand make_set_sunrise_to_time_command(const component::time::RealTime &time)
Set this commant to set sunrise to real time.
Definition: user_commands.cpp:84
static UserCommand make_set_ble_custom_color_mode_command(const uint8_t red, const uint8_t green, const uint8_t blue)
Set this commant to set ble custom color.
Definition: user_commands.cpp:96
bool parse_set_real_time_command(component::time::RealTime &time) const
Parse the current command for a set real time value.
Definition: user_commands.cpp:268
Program scope.
Definition: control_fixed_modes.hpp:14
uint16_t brightness_t
Define the type of the brightness parameters.
Definition: constants.h:151
Store a real time reference.
Definition: time_handling.h:18
Define the system hardware constants.