Ejemplo n.º 1
0
async def logger_log_action_to_code(config, action_id, template_arg, args):
    esp_log = LOG_LEVEL_TO_ESP_LOG[config[CONF_LEVEL]]
    args_ = [cg.RawExpression(str(x)) for x in config[CONF_ARGS]]

    text = str(cg.statement(esp_log(config[CONF_TAG], config[CONF_FORMAT], *args_)))

    lambda_ = await cg.process_lambda(Lambda(text), args, return_type=cg.void)
    return cg.new_Pvariable(action_id, template_arg, lambda_)
Ejemplo n.º 2
0
async def logger_log_action_to_code(config, action_id, template_arg, args):
    args_ = [cg.RawExpression(str(x)) for x in config[CONF_ARGS]]

    text = str(
        cg.statement(
            GLOBAL_BLE_CONTROLLER_VAR.send_command_result(
                config[CONF_FORMAT], *args_)))

    lambda_ = await cg.process_lambda(Lambda(text), args, return_type=cg.void)
    return cg.new_Pvariable(action_id, template_arg, lambda_)