mysensors

package
v2.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2023 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LabelImperialSystem    = "ms_imperial_system"  // this is bool label, used to configure about the system metric or imperial
	LabelNodeID            = "ms_node_id"          // MySensors node id
	LabelSensorID          = "ms_sensor_id"        // MySensors sensor id
	LabelType              = "ms_type"             // MySensors type reference, can be used for sensor fields
	LabelTypeString        = "ms_type_string"      // MySensors type in string format
	LabelNodeType          = "ms_node_type"        // MySensors node type
	LabelLockedReason      = "ms_locked_reason"    // If the the node is locked, reason will be in this label
	LabelEraseEEPROM       = "ms_erase_eeprom"     // Supports only for MYSBootloader, on a reboot of node, the node eeprom will be erased
	LabelFirmwareTypeID    = "ms_type_id"          // MySensors firmware type id
	LabelFirmwareVersionID = "ms_version_id"       // MySensors firmware version id
	LabelSmartSleepNode    = "ms_smart_sleep_node" // set true, if it is a smart sleeping node

	FieldAwakeDuration = "awake_duration" // smart sleep node awake duration
	FieldSleepDuration = "sleep_duration" // smart sleep node sleep duration
)

Labels and fields used in this provider

View Source
const (
	OTABlockOrderForward = "forward" // forward order of block will be asked, 0,1,2...
	OTABlockOrderReverse = "reverse" // reverse order of block will be asked, ...3,2,1,0

)

internal references

View Source
const (
	PluginMySensorsV2 = "mysensors_v2"
)

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, config *gwTY.Config) (providerTY.Plugin, error)

MySensors v2 provider

Types

type Config

type Config struct {
	Type                     string         `json:"type" yaml:"type"`
	EnableStreamMessageAck   bool           `json:"enableStreamMessageAck" yaml:"enableStreamMessageAck"`
	EnableInternalMessageAck bool           `json:"enableInternalMessageAck" yaml:"enableInternalMessageAck"`
	RetryCount               int            `json:"retryCount" yaml:"retryCount"`
	Timeout                  string         `json:"timeout" yaml:"timeout"`
	Protocol                 cmap.CustomMap `json:"protocol" yaml:"protocol"`
}

Config of this provider

type Provider

type Provider struct {
	Config        *Config
	GatewayConfig *gwTY.Config
	Protocol      gwPtl.Protocol
	ProtocolType  string
	// contains filtered or unexported fields
}

Provider implementation

func (*Provider) Close

func (p *Provider) Close() error

Close func

func (*Provider) ConvertToMessages

func (p *Provider) ConvertToMessages(rawMsg *msgTY.RawMessage) ([]*msgTY.Message, error)

ConvertToMessages converts to mycontroller specific format

func (*Provider) Name

func (p *Provider) Name() string

func (*Provider) Post

func (p *Provider) Post(msg *msgTY.Message) error

Post func returns the status and error message if any

func (*Provider) Start

func (p *Provider) Start(receivedMessageHandler func(rawMsg *msgTY.RawMessage) error) error

Start func

Jump to

Keyboard shortcuts

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