|
dolibarr 25.0.0-alpha
|
Class ToolCoffeeMaker. More...


Public Member Functions | |
| __construct (DoliDB $db) | |
| Constructor. | |
| getDefinitions () | |
| Returns tool definitions if the hidden constant is enabled. | |
| getRequiredRights (string $toolName) | |
| No business data. | |
| getCategories () | |
| Return categories this tool belongs to. | |
| execute (string $name, array $args) | |
| Executes the requested tool function based on its name. | |
Public Member Functions inherited from McpTool | |
| __construct ($db, $user, $conf) | |
| Constructor. | |
| isSystem () | |
| Return true if this is a system/infrastructure tool that must always remain visible and executable regardless of the admin allow-list. | |
| writeConfirmationPreview (string $toolName, array $args) | |
| Preview of what a call would write, or NO_WRITE for a read tool. | |
Public Attributes | |
| const | COFFEE_TYPES |
| Beverages the bridge accepts; the Home Assistant script receives the value verbatim as coffee_type and decides what its machine can brew. | |
Public Attributes inherited from McpTool | |
| const | RIGHTS_UNDECLARED = 'undeclared' |
| Default of getRequiredRights(): the class never declared anything, deny. | |
| const | NO_WRITE = '' |
| Returned by writeConfirmationPreview() when the tool writes nothing. | |
Private Member Functions | |
| brewCoffee (array $args) | |
| Triggers the Home Assistant API dynamically using stored configuration. | |
Class ToolCoffeeMaker.
Easter Egg tool to bridge Dolibarr MCP with local Home Assistant coffee configurations.
Definition at line 31 of file coffeemaker.class.php.
| ToolCoffeeMaker::__construct | ( | DoliDB | $db | ) |
Constructor.
Definition at line 51 of file coffeemaker.class.php.
|
private |
Triggers the Home Assistant API dynamically using stored configuration.
| array<string,mixed> | $args Input filters (type, intensity) |
Definition at line 143 of file coffeemaker.class.php.
References dol_syslog(), getDolGlobalString(), and getURLContent().
Referenced by execute().
| ToolCoffeeMaker::execute | ( | string | $name, |
| array | $args ) |
Executes the requested tool function based on its name.
| string | $name | The name of the tool to execute. |
| array<string,mixed> | $args The arguments for the tool. |
Reimplemented from McpTool.
Definition at line 122 of file coffeemaker.class.php.
References brewCoffee(), and getDolGlobalInt().
| ToolCoffeeMaker::getCategories | ( | ) |
Return categories this tool belongs to.
Reimplemented from McpTool.
Definition at line 110 of file coffeemaker.class.php.
| ToolCoffeeMaker::getDefinitions | ( | ) |
Returns tool definitions if the hidden constant is enabled.
Reimplemented from McpTool.
Definition at line 61 of file coffeemaker.class.php.
References COFFEE_TYPES, and getDolGlobalInt().
| ToolCoffeeMaker::getRequiredRights | ( | string | $toolName | ) |
No business data.
| string | $toolName | Tool being executed. |
Reimplemented from McpTool.
Definition at line 100 of file coffeemaker.class.php.