From 72acb64fef13437c2bd94d6827d3975602849ec4 Mon Sep 17 00:00:00 2001 From: Maciej Bieniek Date: Wed, 9 Apr 2025 07:25:43 +0200 Subject: [PATCH] Add a note about the location of the event emitting function to the Shelly documentation (#38447) * Add note about emitEvent * Apply code rabbit suggestion --- source/_integrations/shelly.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/_integrations/shelly.markdown b/source/_integrations/shelly.markdown index c6ae4a0d2a5..81ea11b0597 100644 --- a/source/_integrations/shelly.markdown +++ b/source/_integrations/shelly.markdown @@ -163,6 +163,10 @@ If the **Input Mode** of the switch connected to the device is set to `Button`, Each script which generates events using [Shelly.emitEvent()](https://shelly-api-docs.shelly.cloud/gen2/Scripts/ShellyScriptLanguageFeatures#shellyemitevent) also gets an corresponding event entity. This entity is disabled by default. After changing a script, it's required to manually reload the device before new event types show up. +{% note %} +To avoid increased startup time, only the first 5 KB of the script is downloaded and analyzed. If your script exceeds 5 KB, place the event emitting function at the beginning to ensure it is processed. +{% endnote %} + For example, the following script will emit an event every time an input (button or switch) on the device is changed. ```javascript