Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DeviceConfig ¶
type DeviceConfig struct {
// Name is the device's ESPHome name. It's the MQTT username the device must connect with
// (the "username" under "mqtt:" in its YAML) and the root of the topic tree it may use, so its
// "topic_prefix" must be left at its default, which is this same name.
Name string
// Password is the MQTT password the device must connect with.
Password string
// DisplayName is the name to show for the device. If empty, the name the device announces for
// itself is used, falling back to Name.
DisplayName string
}
DeviceConfig is one ESPHome device allowed to connect to the plugin's broker.
type Plugin ¶
type Plugin interface {
spi.IPMAASPlugin
}
func NewPlugin ¶
func NewPlugin(config PluginConfig) Plugin
type PluginConfig ¶
type PluginConfig struct {
// ListenAddress is the address the embedded MQTT broker listens on. Defaults to ":1883".
ListenAddress string
// DiscoveryPrefix is the MQTT discovery topic prefix devices publish their entity configs
// under. Defaults to "homeassistant", which is ESPHome's default.
DiscoveryPrefix string
// Devices lists the devices allowed to connect. A connection from anything else is refused.
Devices []DeviceConfig
// CaptureMessages logs every message a device publishes. It's for working out what a new kind
// of device actually sends; leave it off otherwise.
CaptureMessages bool
}
PluginConfig configures the plugin.
func NewPluginConfig ¶
func NewPluginConfig() PluginConfig
func (*PluginConfig) AddDevice ¶
func (c *PluginConfig) AddDevice(device DeviceConfig)
AddDevice allows a device to connect.
Directories
¶
| Path | Synopsis |
|---|---|
|
internal
|
|
|
broker
Package broker embeds an MQTT broker (mochi-mqtt) with per-device authentication and topic ACLs, and reports what devices publish and when they connect or disconnect.
|
Package broker embeds an MQTT broker (mochi-mqtt) with per-device authentication and topic ACLs, and reports what devices publish and when they connect or disconnect. |
|
entities
Package entities holds the entities this plugin registers with the container, and the stubs it hands out for them.
|
Package entities holds the entities this plugin registers with the container, and the stubs it hands out for them. |
|
hadiscovery
Package hadiscovery parses the subset of Home Assistant style MQTT discovery that ESPHome (and Tasmota) publish to describe their entities: a retained JSON config per entity at <discovery_prefix>/<component>/[<node_id>/]<object_id>/config, with an empty payload meaning the entity was removed.
|
Package hadiscovery parses the subset of Home Assistant style MQTT discovery that ESPHome (and Tasmota) publish to describe their entities: a retained JSON config per entity at <discovery_prefix>/<component>/[<node_id>/]<object_id>/config, with an empty payload meaning the entity was removed. |
Click to show internal directories.
Click to hide internal directories.