Skip to content

Commit 72acb64

Browse files
authored
Add a note about the location of the event emitting function to the Shelly documentation (#38447)
* Add note about emitEvent * Apply code rabbit suggestion
1 parent 7111e0f commit 72acb64

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

source/_integrations/shelly.markdown

+4
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ If the **Input Mode** of the switch connected to the device is set to `Button`,
163163

164164
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.
165165

166+
{% note %}
167+
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.
168+
{% endnote %}
169+
166170
For example, the following script will emit an event every time an input (button or switch) on the device is changed.
167171

168172
```javascript

0 commit comments

Comments
 (0)