diff --git a/docs/api.md b/docs/api.md index 587cf11..c7bb2ba 100644 --- a/docs/api.md +++ b/docs/api.md @@ -197,14 +197,14 @@ Ideal for user interfaces that require real-time text updates, such as status me **Parameters:** - `id` (string): Identifier of the component whose text will be updated. Ensure this matches the component's ID in your display layout. -- `text` (string): The new text content to display. This can include static text or dynamic information passed at runtime. +- `txt` (string): The new text content to display. This can include static text or dynamic information passed at runtime. **Home Assistant Example:** ```yaml service: esphome._component_text data: id: "home.time" - text: "12:34" + txt: "12:34" ``` > [!NOTE] > Replace `` with your specific panel name as configured in Home Assistant to ensure correct service execution. diff --git a/esphome/nspanel_esphome_core.yaml b/esphome/nspanel_esphome_core.yaml index 8a9db8b..36593e8 100644 --- a/esphome/nspanel_esphome_core.yaml +++ b/esphome/nspanel_esphome_core.yaml @@ -352,24 +352,24 @@ api: # # Parameters: # - id (string): Identifier of the component. Ensure it matches the component's ID in your display layout. - # - text (string): New text content to be displayed. Supports both static and dynamic content. + # - txt (string): New text content to be displayed. Supports both static and dynamic content. # # Example service call: # service: esphome._component_text # data: # id: "home.time" # Component ID to update. Match this with your display's component ID. - # text: "12:34" # New text content to display. + # txt: "12:34" # New text content to display. # # NOTE: Replace with your specific panel name in your Home Assistant setup. # Ensure 'id' accurately targets the correct component for the text update to be successful. - service: component_text variables: id: string - text: string + txt: string then: - lambda: |- if (!id(is_uploading_tft)) - disp1->set_component_text_printf(id.c_str(), "%s", text.c_str()); + disp1->set_component_text_printf(id.c_str(), "%s", txt.c_str()); # Component Value Service # This service updates the numerical value of a specified component on the display,