shelly

package module
v0.0.0-...-5d2b6ea Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

README

Shelly Client

Build and Test

This is a shelly api client for golang. It provides functions for shelly's with and without energymeter.

Implemented Shelly's

  • Shelly 1Plus

Usage

Call go get github.com/darkmatus/shelly in your project.

Create your required instance (current only Shelly 1plus is supported):

    client, err := shelly.NewShelly(deviceType, authKey, baseURL, deviceID)
    if err != nil {
        return
    }

Use the shelly.Device* constants to create your device. To use the Cloud Control API, you need the API key and the server uri. Both can be found in the shelly cloud app or in the shelly control center.

How to add a client.

If you want to add a new client, implement the ShellyInterface for devices which are switches. The interface requires on, off, toggle and getDeviceStatus. Don't forget to write tests. Add create a merge request.

Documentation

Index

Constants

View Source
const (
	Device1Plus = "1plus"
)

Variables

This section is empty.

Functions

func NewShelly

func NewShelly(deviceType string, authKey string, baseURL string, deviceID string) (clients.ShellyInterface, error)

NewShelly creates a Shelly charger from generic config

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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