shelly

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: May 3, 2024 License: MPL-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Shelly

type Shelly struct {
	// contains filtered or unexported fields
}

func NewShelly

func NewShelly(mqttClient mqtt.Client) *Shelly

func (*Shelly) SetDeviceDiscoveredHandler

func (s *Shelly) SetDeviceDiscoveredHandler(f func(*ShellyDevice))

Set the function that get called when a new Deconz Device is discovered

func (*Shelly) Start

func (s *Shelly) Start() error

func (*Shelly) StartDiscovery

func (s *Shelly) StartDiscovery()

func (*Shelly) Stop

func (s *Shelly) Stop()

func (*Shelly) StopDiscovery

func (s *Shelly) StopDiscovery()

type ShellyDevice

type ShellyDevice struct {
	Id                   string `json:"id,omitempty"`
	Model                string `json:"model,omitempty"`
	MACAddress           string `json:"mac,omitempty"`
	IPAddress            string `json:"ip,omitempty"`
	NewFirewareAvailable bool   `json:"new_fw,omitempty"`
	FirmewareVersion     string `json:"fw_ver,omitempty"`

	State string
	// contains filtered or unexported fields
}

func (*ShellyDevice) AddMsgReceivedFunc

func (d *ShellyDevice) AddMsgReceivedFunc(topic string, f func(payload []byte))

Add a function that is called when a message is eceiverd from a Shelly device on a selected topic

func (*ShellyDevice) IsOn

func (e *ShellyDevice) IsOn() bool

func (*ShellyDevice) Subscribe added in v0.1.7

func (e *ShellyDevice) Subscribe()

func (*ShellyDevice) Toggle

func (e *ShellyDevice) Toggle() error

func (*ShellyDevice) TurnOff

func (e *ShellyDevice) TurnOff() error

func (*ShellyDevice) TurnOn

func (e *ShellyDevice) TurnOn() error

func (*ShellyDevice) Unsubscribe added in v0.1.7

func (e *ShellyDevice) Unsubscribe()

Jump to

Keyboard shortcuts

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