mysensors

package
v2.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2026 License: Apache-2.0 Imports: 37 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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

	// LabelFotaScript is the data_repository id that holds custom FOTA policy scripts
	// (data.onConfig required, data.onBlock optional). When set (non-empty after trim),
	// firmware selection is owned by those scripts; assigned_firmware is never used.
	// If the repository is missing or data.disabled is true, no firmware is served.
	// When empty, stock path uses assigned_firmware.
	LabelFotaScript = "fota_script"
	// LabelFotaDisabled on a node turns off all OTA for that node (script and stock).
	// ParseBool: true/1. Missing or false keeps FOTA enabled.
	LabelFotaDisabled = "fota_disabled"

	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 LabelOtaBlockSize = "ms_ota_block_size"

LabelOtaBlockSize is set from the node's CONFIG_REQUEST blockSize (protocol 3.1).

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