deployer

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 26, 2026 License: MIT Imports: 9 Imported by: 0

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 DeployAppend(scriptName string, scriptNum int, code string, shellyURL string) error

func DeployToShelly

func DeployToShelly(code []byte, deployURL string) error

func Upload added in v0.3.0

func Upload(host string, scriptID int, filePath string) error

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

func UploadCode(host string, scriptID int, code string) error

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL