Documentation
¶
Overview ¶
Package deployer provides functions to upload scripts to Shelly Gen2+ devices.
Index ¶
Constants ¶
View Source
const ChunkSize = 1024
ChunkSize is the maximum number of bytes per upload request. Shelly devices have a limit of approximately 1024 bytes per RPC request.
Variables ¶
This section is empty.
Functions ¶
func DeployAppend ¶ added in v0.1.3
func DeployToShelly ¶
func Upload ¶ added in v0.3.0
Upload uploads a JavaScript file to a Shelly device. It reads the file, splits it into chunks, and sends them via the Script.PutCode RPC.
Parameters:
- host: IP address or hostname of the Shelly device (e.g., "192.168.1.100")
- scriptID: Script slot on the device (1-10)
- filePath: Path to the JavaScript file to upload
Returns an error if the upload fails.
func UploadCode ¶ added in v0.3.0
UploadCode uploads JavaScript code directly to a Shelly device. Use this when you already have the code in memory (e.g., after building).
Parameters:
- host: IP address or hostname of the Shelly device
- scriptID: Script slot on the device (1-10)
- code: JavaScript code to upload
Returns an error if the upload fails.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.