auto-formatting

This commit is contained in:
proddy
2026-06-28 14:39:02 +02:00
parent 61d3ad023a
commit 7f308f4036
7 changed files with 33 additions and 34 deletions

View File

@@ -13,11 +13,7 @@ import VisibilityOutlinedIcon from '@mui/icons-material/VisibilityOutlined';
import type { SvgIconProps } from '@mui/material'; import type { SvgIconProps } from '@mui/material';
export type OptionType = export type OptionType =
| 'deleted' 'deleted' | 'readonly' | 'web_exclude' | 'api_mqtt_exclude' | 'favorite';
| 'readonly'
| 'web_exclude'
| 'api_mqtt_exclude'
| 'favorite';
type IconPair = [ type IconPair = [
React.ComponentType<SvgIconProps>, React.ComponentType<SvgIconProps>,

View File

@@ -381,8 +381,8 @@ uint8_t Command::call(const uint8_t device_type, const char * command, const cha
// for the Commands device, calling a named command executes it (using its stored value) // for the Commands device, calling a named command executes it (using its stored value)
// rather than returning its definition, so skip the value-info lookup and fall through // rather than returning its definition, so skip the value-info lookup and fall through
// to the registered command function. The list keywords above are still handled. // to the registered command function. The list keywords above are still handled.
bool is_named_command = (device_type == EMSdevice::DeviceType::COMMAND) && strcmp(cmd, F_(info)) && strcmp(cmd, F_(values)) bool is_named_command = (device_type == EMSdevice::DeviceType::COMMAND) && strcmp(cmd, F_(info)) && strcmp(cmd, F_(values)) && strcmp(cmd, F_(entities))
&& strcmp(cmd, F_(entities)) && strcmp(cmd, F_(metrics)); && strcmp(cmd, F_(metrics));
if (!is_named_command && EMSESP::get_device_value_info(output, cmd, id, device_type)) { // entity = cmd if (!is_named_command && EMSESP::get_device_value_info(output, cmd, id, device_type)) { // entity = cmd
LOG_DEBUG("Fetched device entity/attributes for %s/%s (id=%d)", dname, cmd, id); LOG_DEBUG("Fetched device entity/attributes for %s/%s (id=%d)", dname, cmd, id);
return CommandRet::OK; return CommandRet::OK;

View File

@@ -116,8 +116,11 @@ class Command {
static void static void
add(const uint8_t device_type, const char * cmd, const cmd_function_p cb, const char * const * description, uint8_t flags = CommandFlag::CMD_FLAG_DEFAULT); add(const uint8_t device_type, const char * cmd, const cmd_function_p cb, const char * const * description, uint8_t flags = CommandFlag::CMD_FLAG_DEFAULT);
// command that writes a JSON object as its output; bypasses the readonly check // command that writes a JSON object as its output; bypasses the readonly check
static void static void add_json(const uint8_t device_type,
add_json(const uint8_t device_type, const char * cmd, const cmd_function_p cb, const char * const * description, uint8_t flags = CommandFlag::CMD_FLAG_DEFAULT); const char * cmd,
const cmd_function_p cb,
const char * const * description,
uint8_t flags = CommandFlag::CMD_FLAG_DEFAULT);
static void reserve(size_t num) { static void reserve(size_t num) {
cmdfunctions_.reserve(num); cmdfunctions_.reserve(num);