From 9c7172c4d5b660f69078747bf3b6fa8c5b814fd6 Mon Sep 17 00:00:00 2001 From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com> Date: Mon, 19 Feb 2024 08:58:57 +0100 Subject: [PATCH] Lint --- esphome/nspanel_esphome_advanced.yaml | 1 - esphome/nspanel_esphome_core.yaml | 41 +++++++++++++-------------- 2 files changed, 19 insertions(+), 23 deletions(-) diff --git a/esphome/nspanel_esphome_advanced.yaml b/esphome/nspanel_esphome_advanced.yaml index d3cad67..08ca489 100644 --- a/esphome/nspanel_esphome_advanced.yaml +++ b/esphome/nspanel_esphome_advanced.yaml @@ -92,5 +92,4 @@ time: then: - component.update: api_timestamp - component.update: device_timestamp - ... diff --git a/esphome/nspanel_esphome_core.yaml b/esphome/nspanel_esphome_core.yaml index 90a1f1c..906ef03 100644 --- a/esphome/nspanel_esphome_core.yaml +++ b/esphome/nspanel_esphome_core.yaml @@ -172,6 +172,7 @@ web_server: password: ${web_password} ##### START - API CONFIGURATION ##### +# yamllint disable rule:comments-indentation api: id: api_server reboot_timeout: 0s @@ -213,7 +214,7 @@ api: # NOTE: Replace with your panel's name configured in Home Assistant. # Customize the button's properties as needed to align with your UI design and functionality requirements. # Utilize the HASwitchPlate Material Design Icons for a wide range of icon options. - - service: button + - service: button # yamllint disable-line rule:indentation variables: page: string id: string @@ -410,13 +411,16 @@ api: disp1->set_component_value(id.c_str(), val); # entity_details_show Service - PENDING FULL IMPLEMENTATION - # Enables navigation to a page displaying detailed information about a specific entity and defines a clear path for returning to a previous page, enhancing user interaction within the interface. + # Enables navigation to a page displaying detailed information about a specific entity and defines a clear path for returning to a previous page, + # enhancing user interaction within the interface. # - # Usage: Simplifies access to detailed information for entities, providing users with a detailed view and a straightforward method to navigate back to a main or context-specific page. + # Usage: Simplifies access to detailed information for entities, providing users with a detailed view + # and a straightforward method to navigate back to a main or context-specific page. # # Parameters: # - entity_id (string): Identifier for the entity whose detailed information is to be displayed. - # - back_page (string): Specifies the page to return to after viewing details. Options are limited to `home`, `buttonpage01`, `buttonpage02`, `buttonpage03`, and `buttonpage04` to ensure consistent and predictable navigation. + # - back_page (string): Specifies the page to return to after viewing details. + # Options are limited to `home`, `buttonpage01`, `buttonpage02`, `buttonpage03`, and `buttonpage04` to ensure consistent and predictable navigation. # # Example service call: # service: esphome._entity_details_show @@ -424,7 +428,8 @@ api: # entity_id: "light.living_room" # back_page: "home" # Or "buttonpage01" to "buttonpage04" as appropriate. # - # NOTE: Tailor , entity_id, and back_page to match your specific setup. This approach ensures a seamless and intuitive navigation experience, facilitating easy access to and from detailed entity information. + # NOTE: Tailor , entity_id, and back_page to match your specific setup. + # This approach ensures a seamless and intuitive navigation experience, facilitating easy access to and from detailed entity information. - service: entity_details_show variables: entity: string @@ -662,7 +667,8 @@ api: # Init Page Settings Service # Populates the "Settings" page with user-configurable options, aligning with the project's blueprint for a cohesive and intuitive settings interface. # - # Usage: Integral to the initial setup and ongoing refinement of the "Settings" page, allowing for label customization and functional adjustments like reboot options and brightness control from the panel interface. + # Usage: Integral to the initial setup and ongoing refinement of the "Settings" page, + # allowing for label customization and functional adjustments like reboot options and brightness control from the panel interface. # # Parameters: # - reboot (string): Label for the reboot button, directing users on restarting the device. @@ -770,11 +776,13 @@ api: # Notification Show Service # Displays a notification message on the screen, useful for alerts or informational updates. # - # Usage: Ideal for immediate feedback or notifications through the display interface. Automatic text wrapping occurs to fit the display, but manual line breaks can be inserted with `\r` for precise formatting. + # Usage: Ideal for immediate feedback or notifications through the display interface. Automatic text wrapping occurs to fit the display, + # but manual line breaks can be inserted with `\r` for precise formatting. # # Parameters: # - label (string): Title or label for the notification, displayed in a prominent format. - # - message (string): Detailed message or content of the notification. Include `\r` to insert a line break, allowing for custom formatting. Without `\r`, text will wrap according to the display's dimensions. + # - message (string): Detailed message or content of the notification. Include `\r` to insert a line break, allowing for custom formatting. + # Without `\r`, text will wrap according to the display's dimensions. # # Example service call: # service: esphome._notification_show @@ -1025,7 +1033,8 @@ api: # - media_duration (float): Total duration of the current media in seconds. # - media_position (float): Current playback position in the media in seconds. # - media_position_delta (float): Time elapsed since the last media position update in seconds. - # - supported_features (int): Bitmask indicating the media player's supported features (e.g., play, pause, volume control). Refer to Home Assistant Media Player Supported Features for detailed bitmask values: https://github.com/home-assistant/core/blob/33ff6b5b6ee3d92f4bb8deb9594d67748ea23d7c/homeassistant/components/media_player/const.py#L23 + # - supported_features (int): Bitmask indicating the media player's supported features (e.g., play, pause, volume control). + # Refer to Home Assistant Media Player Supported Features for detailed bitmask values: https://github.com/home-assistant/core/blob/33ff6b5b6ee3d92f4bb8deb9594d67748ea23d7c/homeassistant/components/media_player/const.py#L23 # # Example service call: # service: esphome._page_media_player @@ -1301,6 +1310,7 @@ api: disp1->set_component_text_printf(ent_id.c_str(), "%s", ent_value.c_str()); if (strcmp(ent_value_xcen.c_str(), "0") != 0) disp1->send_command_printf("%s", entxcen.c_str()); } +# yamllint enable rule:comments-indentation ##### START - DISPLAY START CONFIGURATION ##### display: @@ -2652,10 +2662,6 @@ script: - id: entity_details_show mode: restart parameters: - #page: string - #page_label: string - #page_icon: string - #page_icon_color: int32_t[] entity: string back_page: string then: @@ -2668,18 +2674,9 @@ script: if (page == "alarm_control_panel") page = "alarm"; std::string cmd_page = std::string("page ") + page.c_str(); disp1->send_command_printf(cmd_page.c_str()); - //if (page_label.find("\\r") != std::string::npos) - // page_label = page_label.replace(page_label.find("\\r"), 2, " "); - //disp1->set_component_text_printf("page_label", "%s", page_label.c_str()); set_page_id->execute("back_page_id", back_page.c_str()); if (page == "climate") disp1->set_component_value("embedded", (entity == "embedded_climate") ? 1 : 0); - //else - // { - // if ((page_icon != std::string()) and (page_icon != "")) - // disp1->set_component_text_printf("icon_state", "%s", page_icon.c_str()); - // set_component_color->execute("icon_state", page_icon_color); - // } } - id: page_alarm