zigbee2mqtt

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package zigbee2mqtt contains a handler for dealing with zigbee2mqtt messages

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	FriendlyName       string           `json:"friendly_name"`
	IEEEAddress        string           `json:"ieee_address"`
	InterviewCompleted bool             `json:"interview_completed"`
	Interviewing       bool             `json:"interviewing"`
	NetworkAddress     int              `json:"network_address"`
	Supported          bool             `json:"supported"`
	Type               string           `json:"type"`
	Definition         DeviceDefinition `json:"definition"`
	ModelID            string           `json:"model_id"`
}

Device is a structure which contains the information about an zigbee2mqtt device.

type DeviceAttribute

type DeviceAttribute struct {
	Access      int    `json:"access"`
	Description string `json:"description"`
	Name        string `json:"name"`
	Property    string `json:"property"`
	Type        string `json:"type"`
	Unit        string `json:"unit"`
	ValueMax    int    `json:"value_max"`
	ValueMin    int    `json:"value_min"`
}

DeviceAttribute is an attribute which the device exposes to the user.

type DeviceDefinition

type DeviceDefinition struct {
	Description string            `json:"description"`
	Exposes     []DeviceAttribute `json:"exposes"`
	Model       string            `json:"model"`
	SupportsOTA bool              `json:"supports_ota"`
	Vendor      string            `json:"vendor"`
}

DeviceDefinition is a structure which contains the definition of a zigbee2mqtt device.

type Handler

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

Handler handles zigbee2mqtt messages

func New

func New(client *mongo.Client) *Handler

New creates a new handler.

func (*Handler) Connected

func (h *Handler) Connected(client mqtt.Client)

Connected is a handler which is called when the initial connection to the mqtt server is established.

func (*Handler) DefaultPublished

func (h *Handler) DefaultPublished(client mqtt.Client, message mqtt.Message)

DefaultPublished is a handler which is called when a message is received but no explicit handler is called.

func (*Handler) Disconnected

func (h *Handler) Disconnected(client mqtt.Client, err error)

Disconnected is called when the client disconnects from mqtt.

Jump to

Keyboard shortcuts

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