Documentation ¶
Overview ¶
Package presence provides the core functionality of the wifi-presence app.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon runs the main wifi-presence program loop.
type MAC ¶
type MAC [6]byte
MAC is a hardware MAC address.
func (MAC) MarshalJSON ¶
MarshalJSON returns the JSON representation of m.
func (MAC) String ¶
String returns the address in a "XX:XX:XX:XX:XX" formatted string (lower-case letters).
func (*MAC) UnmarshalJSON ¶
UnmarshalJSON decodes the JSON representation of a mac into m.
type Opt ¶
type Opt func(*Daemon)
Opt is a configuration option for Daemon.
func WithAPName ¶
WithAPName sets the name of the Access Point. This name is used for station attributes and topic path creation.
func WithDebounce ¶
WithDebounce is optionally and sets the debounce time for station connect/disconnect events.
func WithHASSAutodiscovery ¶
WithHASSAutodiscovery configures whether daemon will publish MQTT autodiscovery messages for Home Assistant.
func WithHassOpt ¶
WithHassOpt is required and sets the hass.MQTT the daemon will use.
func WithHostAPD ¶
WithHostAPD is required at least once and sets the hostapd.Client the daemon will use. Multple hostapd.Clients may be used.
func WithLogger ¶
WithLogger is optional and defines a logger for the daemon to use.