entities

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: MIT Imports: 10 Imported by: 1

Documentation

Index

Constants

View Source
const DiscoveryPrefix = "homeassistant"

DiscoveryPrefix is the prefix that HA uses to discover on. Does not usually need changing.

Variables

View Source
var InstanceName = "Better MQTT Room"

InstanceName is the instance name, helpful for identifying a given client

View Source
var Manufacturer = "Kjell Breiland"
View Source
var NodeID = "better-mqtt-room"

NodeID is the Node ID, that is, what that node connects under.

View Source
var SWVersion = "0.0.1"

SWVersion is the software version.

View Source
var SoftwareName = "Better MQTT Room"

Functions

func AvailabilityFunc

func AvailabilityFunc() string

func GetDiscoveryTopic

func GetDiscoveryTopic(e Entity) string

func GetTopic

func GetTopic(e Entity, rawTopicString string) string

func GetTopicPrefix

func GetTopicPrefix(e Entity) string

func MakeMessageHandler

func MakeMessageHandler(e Entity) func(client mqtt.Client, msg mqtt.Message)

func NewLightRef added in v0.2.0

func NewLightRef(opts *LightRefOptions)

Types

type AlarmControlPanel

type AlarmControlPanel struct {
	AvailabilityMode     *string `json:"availability_mode,omitempty"`     // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability."
	AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`."
	AvailabilityTopic    *string `json:"availability_topic,omitempty"`    // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`."

	Code                *string `json:"code,omitempty"`                  // "If defined, specifies a code to enable or disable the alarm in the frontend. Note that the code is validated locally and blocks sending MQTT messages to the remote device. For remote code validation, the code can be configured to either of the special values `REMOTE_CODE` (numeric code) or `REMOTE_CODE_TEXT` (text code). In this case, local code validation is bypassed but the frontend will still show a numeric or text code dialog. Use `command_template` to send the code to the remote device. Example configurations for remote code validation [can be found here](./#configurations-with-remote-code-validation)."
	CodeArmRequired     *bool   `json:"code_arm_required,omitempty"`     // "If true the code is required to arm the alarm. If false the code is not validated."
	CodeDisarmRequired  *bool   `json:"code_disarm_required,omitempty"`  // "If true the code is required to disarm the alarm. If false the code is not validated."
	CodeTriggerRequired *bool   `json:"code_trigger_required,omitempty"` // "If true the code is required to trigger the alarm. If false the code is not validated."
	CommandTemplate     *string `json:"command_template,omitempty"`      // "The [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) used for the command payload. Available variables: `action` and `code`."
	CommandTopic        *string `json:"command_topic,omitempty"`         // "The MQTT topic to publish commands to change the alarm state."

	Device                 Device  `json:"device,omitempty"`                   // Device configuration parameters
	EnabledByDefault       *bool   `json:"enabled_by_default,omitempty"`       // "Flag which defines if the entity should be enabled when first added."
	Encoding               *string `json:"encoding,omitempty"`                 // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload."
	EntityCategory         *string `json:"entity_category,omitempty"`          // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity."
	Icon                   *string `json:"icon,omitempty"`                     // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity."
	JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation."
	JsonAttributesTopic    *string `json:"json_attributes_topic,omitempty"`    // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation."

	Name                   *string `json:"name,omitempty"`                      // "The name of the alarm."
	ObjectId               *string `json:"object_id,omitempty"`                 // "Used instead of `name` for automatic generation of `entity_id`"
	PayloadArmAway         *string `json:"payload_arm_away,omitempty"`          // "The payload to set armed-away mode on your Alarm Panel."
	PayloadArmCustomBypass *string `json:"payload_arm_custom_bypass,omitempty"` // "The payload to set armed-custom-bypass mode on your Alarm Panel."
	PayloadArmHome         *string `json:"payload_arm_home,omitempty"`          // "The payload to set armed-home mode on your Alarm Panel."
	PayloadArmNight        *string `json:"payload_arm_night,omitempty"`         // "The payload to set armed-night mode on your Alarm Panel."
	PayloadArmVacation     *string `json:"payload_arm_vacation,omitempty"`      // "The payload to set armed-vacation mode on your Alarm Panel."
	PayloadAvailable       *string `json:"payload_available,omitempty"`         // "The payload that represents the available state."
	PayloadDisarm          *string `json:"payload_disarm,omitempty"`            // "The payload to disarm your Alarm Panel."
	PayloadNotAvailable    *string `json:"payload_not_available,omitempty"`     // "The payload that represents the unavailable state."
	PayloadTrigger         *string `json:"payload_trigger,omitempty"`           // "The payload to trigger the alarm on your Alarm Panel."
	Qos                    *int    `json:"qos,omitempty"`                       // "The maximum QoS level of the state topic."
	Retain                 *bool   `json:"retain,omitempty"`                    // "If the published message should have the retain flag on or not."
	StateTopic             *string `json:"state_topic,omitempty"`               // "The MQTT topic subscribed to receive state updates."

	UniqueId      *string     `json:"unique_id,omitempty"`      // "An ID that uniquely identifies this alarm panel. If two alarm panels have the same unique ID, Home Assistant will raise an exception."
	ValueTemplate *string     `json:"value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the value."
	MQTT          *MQTTFields `json:"-"`                        // MQTT configuration parameters

	States *AlarmControlPanelState `json:"-"` // External state update location
	// contains filtered or unexported fields
}

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewAlarmControlPanel added in v0.2.0

func NewAlarmControlPanel(o *AlarmControlPanelOptions) (*AlarmControlPanel, error)

func (*AlarmControlPanel) AddMessageHandler

func (d *AlarmControlPanel) AddMessageHandler()

func (*AlarmControlPanel) AnnounceAvailable

func (d *AlarmControlPanel) AnnounceAvailable()

func (*AlarmControlPanel) DeleteTopic

func (d *AlarmControlPanel) DeleteTopic()

func (*AlarmControlPanel) GetDomainEntity added in v0.2.3

func (d *AlarmControlPanel) GetDomainEntity() string

func (*AlarmControlPanel) GetMQTTFields

func (d *AlarmControlPanel) GetMQTTFields() (fields MQTTFields)

func (*AlarmControlPanel) GetName

func (d *AlarmControlPanel) GetName() string

func (*AlarmControlPanel) GetRawId

func (d *AlarmControlPanel) GetRawId() string

func (*AlarmControlPanel) GetUniqueId

func (d *AlarmControlPanel) GetUniqueId() string

func (*AlarmControlPanel) Initialize

func (d *AlarmControlPanel) Initialize()

func (*AlarmControlPanel) JsonAttributes added in v0.2.1

func (d *AlarmControlPanel) JsonAttributes(s string)

func (*AlarmControlPanel) PopulateDevice

func (d *AlarmControlPanel) PopulateDevice(Manufacturer string, SoftwareName string, InstanceName string, SWVersion string, Identifier string)

func (*AlarmControlPanel) SetMQTTFields

func (d *AlarmControlPanel) SetMQTTFields(fields MQTTFields)

func (*AlarmControlPanel) State added in v0.2.1

func (d *AlarmControlPanel) State(s string)

func (*AlarmControlPanel) Subscribe

func (d *AlarmControlPanel) Subscribe()

func (*AlarmControlPanel) UnSubscribe

func (d *AlarmControlPanel) UnSubscribe()

func (*AlarmControlPanel) UpdateState

func (d *AlarmControlPanel) UpdateState()

type AlarmControlPanelOptions added in v0.2.0

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

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewAlarmControlPanelOptions added in v0.2.0

func NewAlarmControlPanelOptions() *AlarmControlPanelOptions

func (*AlarmControlPanelOptions) AvailabilityFunc added in v0.2.0

func (o *AlarmControlPanelOptions) AvailabilityFunc(f func() string) *AlarmControlPanelOptions

func (*AlarmControlPanelOptions) AvailabilityMode added in v0.2.0

func (o *AlarmControlPanelOptions) AvailabilityMode(mode string) *AlarmControlPanelOptions

func (*AlarmControlPanelOptions) AvailabilityTemplate added in v0.2.0

func (o *AlarmControlPanelOptions) AvailabilityTemplate(template string) *AlarmControlPanelOptions

func (*AlarmControlPanelOptions) Code added in v0.2.0

func (*AlarmControlPanelOptions) CodeArmRequired added in v0.2.0

func (o *AlarmControlPanelOptions) CodeArmRequired(required bool) *AlarmControlPanelOptions

func (*AlarmControlPanelOptions) CodeDisarmRequired added in v0.2.0

func (o *AlarmControlPanelOptions) CodeDisarmRequired(required bool) *AlarmControlPanelOptions

func (*AlarmControlPanelOptions) CodeTriggerRequired added in v0.2.0

func (o *AlarmControlPanelOptions) CodeTriggerRequired(required bool) *AlarmControlPanelOptions

func (*AlarmControlPanelOptions) CommandFunc added in v0.2.0

func (*AlarmControlPanelOptions) CommandTemplate added in v0.2.0

func (o *AlarmControlPanelOptions) CommandTemplate(template string) *AlarmControlPanelOptions

func (*AlarmControlPanelOptions) EnabledByDefault added in v0.2.0

func (o *AlarmControlPanelOptions) EnabledByDefault(d bool) *AlarmControlPanelOptions

func (*AlarmControlPanelOptions) Encoding added in v0.2.0

func (*AlarmControlPanelOptions) EntityCategory added in v0.2.0

func (o *AlarmControlPanelOptions) EntityCategory(category string) *AlarmControlPanelOptions

func (*AlarmControlPanelOptions) Icon added in v0.2.0

func (*AlarmControlPanelOptions) JsonAttributesFunc added in v0.2.0

func (o *AlarmControlPanelOptions) JsonAttributesFunc(f func() string) *AlarmControlPanelOptions

func (*AlarmControlPanelOptions) JsonAttributesTemplate added in v0.2.0

func (o *AlarmControlPanelOptions) JsonAttributesTemplate(template string) *AlarmControlPanelOptions

func (*AlarmControlPanelOptions) Name added in v0.2.0

func (*AlarmControlPanelOptions) ObjectId added in v0.2.0

func (*AlarmControlPanelOptions) PayloadArmAway added in v0.2.0

func (o *AlarmControlPanelOptions) PayloadArmAway(away string) *AlarmControlPanelOptions

func (*AlarmControlPanelOptions) PayloadArmCustomBypass added in v0.2.0

func (o *AlarmControlPanelOptions) PayloadArmCustomBypass(bypass string) *AlarmControlPanelOptions

func (*AlarmControlPanelOptions) PayloadArmHome added in v0.2.0

func (o *AlarmControlPanelOptions) PayloadArmHome(home string) *AlarmControlPanelOptions

func (*AlarmControlPanelOptions) PayloadArmNight added in v0.2.0

func (o *AlarmControlPanelOptions) PayloadArmNight(night string) *AlarmControlPanelOptions

func (*AlarmControlPanelOptions) PayloadArmVacation added in v0.2.0

func (o *AlarmControlPanelOptions) PayloadArmVacation(vacation string) *AlarmControlPanelOptions

func (*AlarmControlPanelOptions) PayloadAvailable added in v0.2.0

func (o *AlarmControlPanelOptions) PayloadAvailable(available string) *AlarmControlPanelOptions

func (*AlarmControlPanelOptions) PayloadDisarm added in v0.2.0

func (o *AlarmControlPanelOptions) PayloadDisarm(disarm string) *AlarmControlPanelOptions

func (*AlarmControlPanelOptions) PayloadNotAvailable added in v0.2.0

func (o *AlarmControlPanelOptions) PayloadNotAvailable(available string) *AlarmControlPanelOptions

func (*AlarmControlPanelOptions) PayloadTrigger added in v0.2.0

func (o *AlarmControlPanelOptions) PayloadTrigger(trigger string) *AlarmControlPanelOptions

func (*AlarmControlPanelOptions) Qos added in v0.2.0

func (*AlarmControlPanelOptions) Retain added in v0.2.0

func (*AlarmControlPanelOptions) StateFunc added in v0.2.0

func (*AlarmControlPanelOptions) States added in v0.2.0

func (*AlarmControlPanelOptions) UniqueId added in v0.2.0

func (*AlarmControlPanelOptions) ValueTemplate added in v0.2.0

func (o *AlarmControlPanelOptions) ValueTemplate(template string) *AlarmControlPanelOptions

type AlarmControlPanelState added in v0.2.0

type AlarmControlPanelState struct {
	JsonAttributes string
	State          string
}

type BinarySensor

type BinarySensor struct {
	AvailabilityMode     *string `json:"availability_mode,omitempty"`     // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability."
	AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`."
	AvailabilityTopic    *string `json:"availability_topic,omitempty"`    // "The MQTT topic subscribed to receive birth and LWT messages from the MQTT device. If `availability` is not defined, the binary sensor will always be considered `available` and its state will be `on`, `off` or `unknown`. If `availability` is defined, the binary sensor will be considered as `unavailable` by default and the sensor's initial state will be `unavailable`. Must not be used together with `availability`."

	Device                 Device  `json:"device,omitempty"`                   // Device configuration parameters
	DeviceClass            *string `json:"device_class,omitempty"`             // "Sets the [class of the device](/integrations/binary_sensor/#device-class), changing the device state and icon that is displayed on the frontend."
	EnabledByDefault       *bool   `json:"enabled_by_default,omitempty"`       // "Flag which defines if the entity should be enabled when first added."
	Encoding               *string `json:"encoding,omitempty"`                 // "The encoding of the payloads received. Set to `\"\"` to disable decoding of incoming payload."
	EntityCategory         *string `json:"entity_category,omitempty"`          // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity."
	ExpireAfter            *int    `json:"expire_after,omitempty"`             // "If set, it defines the number of seconds after the sensor's state expires, if it's not updated. After expiry, the sensor's state becomes `unavailable`. Default the sensors state never expires."
	ForceUpdate            *bool   `json:"force_update,omitempty"`             // "Sends update events (which results in update of [state object](/docs/configuration/state_object/)'s `last_changed`) even if the sensor's state hasn't changed. Useful if you want to have meaningful value graphs in history or want to create an automation that triggers on *every* incoming state message (not only when the sensor's new state is different to the current one)."
	Icon                   *string `json:"icon,omitempty"`                     // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity."
	JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation."
	JsonAttributesTopic    *string `json:"json_attributes_topic,omitempty"`    // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation."

	Name                *string `json:"name,omitempty"`                  // "The name of the binary sensor."
	ObjectId            *string `json:"object_id,omitempty"`             // "Used instead of `name` for automatic generation of `entity_id`"
	OffDelay            *int    `json:"off_delay,omitempty"`             // "For sensors that only send `on` state updates (like PIRs), this variable sets a delay in seconds after which the sensor's state will be updated back to `off`."
	PayloadAvailable    *string `json:"payload_available,omitempty"`     // "The string that represents the `online` state."
	PayloadNotAvailable *string `json:"payload_not_available,omitempty"` // "The string that represents the `offline` state."
	PayloadOff          *string `json:"payload_off,omitempty"`           // "The string that represents the `off` state. It will be compared to the message in the `state_topic` (see `value_template` for details)"
	PayloadOn           *string `json:"payload_on,omitempty"`            // "The string that represents the `on` state. It will be compared to the message in the `state_topic` (see `value_template` for details)"
	Qos                 *int    `json:"qos,omitempty"`                   // "The maximum QoS level to be used when receiving messages."
	StateTopic          *string `json:"state_topic,omitempty"`           // "The MQTT topic subscribed to receive sensor's state."

	UniqueId      *string     `json:"unique_id,omitempty"`      // "An ID that uniquely identifies this sensor. If two sensors have the same unique ID, Home Assistant will raise an exception."
	ValueTemplate *string     `json:"value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) that returns a string to be compared to `payload_on`/`payload_off` or an empty string, in which case the MQTT message will be removed. Remove this option when `payload_on` and `payload_off` are sufficient to match your payloads (i.e no pre-processing of original message is required)."
	MQTT          *MQTTFields `json:"-"`                        // MQTT configuration parameters

	States *BinarySensorState `json:"-"` // External state update location
	// contains filtered or unexported fields
}

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewBinarySensor added in v0.2.0

func NewBinarySensor(o *BinarySensorOptions) (*BinarySensor, error)

func (*BinarySensor) AddMessageHandler

func (d *BinarySensor) AddMessageHandler()

func (*BinarySensor) AnnounceAvailable

func (d *BinarySensor) AnnounceAvailable()

func (*BinarySensor) DeleteTopic

func (d *BinarySensor) DeleteTopic()

func (*BinarySensor) GetDomainEntity added in v0.2.3

func (d *BinarySensor) GetDomainEntity() string

func (*BinarySensor) GetMQTTFields

func (d *BinarySensor) GetMQTTFields() (fields MQTTFields)

func (*BinarySensor) GetName

func (d *BinarySensor) GetName() string

func (*BinarySensor) GetRawId

func (d *BinarySensor) GetRawId() string

func (*BinarySensor) GetUniqueId

func (d *BinarySensor) GetUniqueId() string

func (*BinarySensor) Initialize

func (d *BinarySensor) Initialize()

func (*BinarySensor) JsonAttributes added in v0.2.1

func (d *BinarySensor) JsonAttributes(s string)

func (*BinarySensor) PopulateDevice

func (d *BinarySensor) PopulateDevice(Manufacturer string, SoftwareName string, InstanceName string, SWVersion string, Identifier string)

func (*BinarySensor) SetMQTTFields

func (d *BinarySensor) SetMQTTFields(fields MQTTFields)

func (*BinarySensor) State added in v0.2.1

func (d *BinarySensor) State(s string)

func (*BinarySensor) Subscribe

func (d *BinarySensor) Subscribe()

func (*BinarySensor) UnSubscribe

func (d *BinarySensor) UnSubscribe()

func (*BinarySensor) UpdateState

func (d *BinarySensor) UpdateState()

type BinarySensorOptions added in v0.2.0

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

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewBinarySensorOptions added in v0.2.0

func NewBinarySensorOptions() *BinarySensorOptions

func (*BinarySensorOptions) AvailabilityFunc added in v0.2.0

func (o *BinarySensorOptions) AvailabilityFunc(f func() string) *BinarySensorOptions

func (*BinarySensorOptions) AvailabilityMode added in v0.2.0

func (o *BinarySensorOptions) AvailabilityMode(mode string) *BinarySensorOptions

func (*BinarySensorOptions) AvailabilityTemplate added in v0.2.0

func (o *BinarySensorOptions) AvailabilityTemplate(template string) *BinarySensorOptions

func (*BinarySensorOptions) DeviceClass added in v0.2.0

func (o *BinarySensorOptions) DeviceClass(class string) *BinarySensorOptions

func (*BinarySensorOptions) EnabledByDefault added in v0.2.0

func (o *BinarySensorOptions) EnabledByDefault(d bool) *BinarySensorOptions

func (*BinarySensorOptions) Encoding added in v0.2.0

func (o *BinarySensorOptions) Encoding(encoding string) *BinarySensorOptions

func (*BinarySensorOptions) EntityCategory added in v0.2.0

func (o *BinarySensorOptions) EntityCategory(category string) *BinarySensorOptions

func (*BinarySensorOptions) ExpireAfter added in v0.2.0

func (o *BinarySensorOptions) ExpireAfter(after int) *BinarySensorOptions

func (*BinarySensorOptions) ForceUpdate added in v0.2.0

func (o *BinarySensorOptions) ForceUpdate(update bool) *BinarySensorOptions

func (*BinarySensorOptions) Icon added in v0.2.0

func (*BinarySensorOptions) JsonAttributesFunc added in v0.2.0

func (o *BinarySensorOptions) JsonAttributesFunc(f func() string) *BinarySensorOptions

func (*BinarySensorOptions) JsonAttributesTemplate added in v0.2.0

func (o *BinarySensorOptions) JsonAttributesTemplate(template string) *BinarySensorOptions

func (*BinarySensorOptions) Name added in v0.2.0

func (*BinarySensorOptions) ObjectId added in v0.2.0

func (*BinarySensorOptions) OffDelay added in v0.2.0

func (o *BinarySensorOptions) OffDelay(delay int) *BinarySensorOptions

func (*BinarySensorOptions) PayloadAvailable added in v0.2.0

func (o *BinarySensorOptions) PayloadAvailable(available string) *BinarySensorOptions

func (*BinarySensorOptions) PayloadNotAvailable added in v0.2.0

func (o *BinarySensorOptions) PayloadNotAvailable(available string) *BinarySensorOptions

func (*BinarySensorOptions) PayloadOff added in v0.2.0

func (o *BinarySensorOptions) PayloadOff(off string) *BinarySensorOptions

func (*BinarySensorOptions) PayloadOn added in v0.2.0

func (*BinarySensorOptions) Qos added in v0.2.0

func (*BinarySensorOptions) StateFunc added in v0.2.0

func (o *BinarySensorOptions) StateFunc(f func() string) *BinarySensorOptions

func (*BinarySensorOptions) States added in v0.2.0

func (*BinarySensorOptions) UniqueId added in v0.2.0

func (*BinarySensorOptions) ValueTemplate added in v0.2.0

func (o *BinarySensorOptions) ValueTemplate(template string) *BinarySensorOptions

type BinarySensorState added in v0.2.0

type BinarySensorState struct {
	JsonAttributes string
	State          string
}

type Button

type Button struct {
	AvailabilityMode     *string `json:"availability_mode,omitempty"`     // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability."
	AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`."
	AvailabilityTopic    *string `json:"availability_topic,omitempty"`    // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`."

	CommandTemplate *string `json:"command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `command_topic`."
	CommandTopic    *string `json:"command_topic,omitempty"`    // "The MQTT topic to publish commands to trigger the button."

	Device                 Device  `json:"device,omitempty"`                   // Device configuration parameters
	DeviceClass            *string `json:"device_class,omitempty"`             // "The [type/class](/integrations/button/#device-class) of the button to set the icon in the frontend."
	EnabledByDefault       *bool   `json:"enabled_by_default,omitempty"`       // "Flag which defines if the entity should be enabled when first added."
	Encoding               *string `json:"encoding,omitempty"`                 // "The encoding of the published messages."
	EntityCategory         *string `json:"entity_category,omitempty"`          // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity."
	Icon                   *string `json:"icon,omitempty"`                     // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity."
	JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation."
	JsonAttributesTopic    *string `json:"json_attributes_topic,omitempty"`    // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation."

	Name                *string     `json:"name,omitempty"`                  // "The name to use when displaying this button."
	ObjectId            *string     `json:"object_id,omitempty"`             // "Used instead of `name` for automatic generation of `entity_id`"
	PayloadAvailable    *string     `json:"payload_available,omitempty"`     // "The payload that represents the available state."
	PayloadNotAvailable *string     `json:"payload_not_available,omitempty"` // "The payload that represents the unavailable state."
	PayloadPress        *string     `json:"payload_press,omitempty"`         // "The payload To send to trigger the button."
	Qos                 *int        `json:"qos,omitempty"`                   // "The maximum QoS level of the state topic. Default is 0 and will also be used to publishing messages."
	Retain              *bool       `json:"retain,omitempty"`                // "If the published message should have the retain flag on or not."
	UniqueId            *string     `json:"unique_id,omitempty"`             // "An ID that uniquely identifies this button entity. If two buttons have the same unique ID, Home Assistant will raise an exception."
	MQTT                *MQTTFields `json:"-"`                               // MQTT configuration parameters

	States *ButtonState `json:"-"` // External state update location
	// contains filtered or unexported fields
}

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewButton added in v0.2.0

func NewButton(o *ButtonOptions) (*Button, error)

func (*Button) AddMessageHandler

func (d *Button) AddMessageHandler()

func (*Button) AnnounceAvailable

func (d *Button) AnnounceAvailable()

func (*Button) DeleteTopic

func (d *Button) DeleteTopic()

func (*Button) GetDomainEntity added in v0.2.3

func (d *Button) GetDomainEntity() string

func (*Button) GetMQTTFields

func (d *Button) GetMQTTFields() (fields MQTTFields)

func (*Button) GetName

func (d *Button) GetName() string

func (*Button) GetRawId

func (d *Button) GetRawId() string

func (*Button) GetUniqueId

func (d *Button) GetUniqueId() string

func (*Button) Initialize

func (d *Button) Initialize()

func (*Button) JsonAttributes added in v0.2.1

func (d *Button) JsonAttributes(s string)

func (*Button) PopulateDevice

func (d *Button) PopulateDevice(Manufacturer string, SoftwareName string, InstanceName string, SWVersion string, Identifier string)

func (*Button) SetMQTTFields

func (d *Button) SetMQTTFields(fields MQTTFields)

func (*Button) Subscribe

func (d *Button) Subscribe()

func (*Button) UnSubscribe

func (d *Button) UnSubscribe()

func (*Button) UpdateState

func (d *Button) UpdateState()

type ButtonOptions added in v0.2.0

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

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewButtonOptions added in v0.2.0

func NewButtonOptions() *ButtonOptions

func (*ButtonOptions) AvailabilityFunc added in v0.2.0

func (o *ButtonOptions) AvailabilityFunc(f func() string) *ButtonOptions

func (*ButtonOptions) AvailabilityMode added in v0.2.0

func (o *ButtonOptions) AvailabilityMode(mode string) *ButtonOptions

func (*ButtonOptions) AvailabilityTemplate added in v0.2.0

func (o *ButtonOptions) AvailabilityTemplate(template string) *ButtonOptions

func (*ButtonOptions) CommandFunc added in v0.2.0

func (o *ButtonOptions) CommandFunc(f func(mqtt.Message, mqtt.Client)) *ButtonOptions

func (*ButtonOptions) CommandTemplate added in v0.2.0

func (o *ButtonOptions) CommandTemplate(template string) *ButtonOptions

func (*ButtonOptions) DeviceClass added in v0.2.0

func (o *ButtonOptions) DeviceClass(class string) *ButtonOptions

func (*ButtonOptions) EnabledByDefault added in v0.2.0

func (o *ButtonOptions) EnabledByDefault(d bool) *ButtonOptions

func (*ButtonOptions) Encoding added in v0.2.0

func (o *ButtonOptions) Encoding(encoding string) *ButtonOptions

func (*ButtonOptions) EntityCategory added in v0.2.0

func (o *ButtonOptions) EntityCategory(category string) *ButtonOptions

func (*ButtonOptions) Icon added in v0.2.0

func (o *ButtonOptions) Icon(icon string) *ButtonOptions

func (*ButtonOptions) JsonAttributesFunc added in v0.2.0

func (o *ButtonOptions) JsonAttributesFunc(f func() string) *ButtonOptions

func (*ButtonOptions) JsonAttributesTemplate added in v0.2.0

func (o *ButtonOptions) JsonAttributesTemplate(template string) *ButtonOptions

func (*ButtonOptions) Name added in v0.2.0

func (o *ButtonOptions) Name(name string) *ButtonOptions

func (*ButtonOptions) ObjectId added in v0.2.0

func (o *ButtonOptions) ObjectId(id string) *ButtonOptions

func (*ButtonOptions) PayloadAvailable added in v0.2.0

func (o *ButtonOptions) PayloadAvailable(available string) *ButtonOptions

func (*ButtonOptions) PayloadNotAvailable added in v0.2.0

func (o *ButtonOptions) PayloadNotAvailable(available string) *ButtonOptions

func (*ButtonOptions) PayloadPress added in v0.2.0

func (o *ButtonOptions) PayloadPress(press string) *ButtonOptions

func (*ButtonOptions) Qos added in v0.2.0

func (o *ButtonOptions) Qos(qos int) *ButtonOptions

func (*ButtonOptions) Retain added in v0.2.0

func (o *ButtonOptions) Retain(retain bool) *ButtonOptions

func (*ButtonOptions) States added in v0.2.0

func (o *ButtonOptions) States() *ButtonState

func (*ButtonOptions) UniqueId added in v0.2.0

func (o *ButtonOptions) UniqueId(id string) *ButtonOptions

type ButtonState added in v0.2.0

type ButtonState struct {
	JsonAttributes string
}

type Camera

type Camera struct {
	AvailabilityMode     *string `json:"availability_mode,omitempty"`     // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability."
	AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`."
	AvailabilityTopic    *string `json:"availability_topic,omitempty"`    // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`."

	Device                 Device  `json:"device,omitempty"`                   // Device configuration parameters
	EnabledByDefault       *bool   `json:"enabled_by_default,omitempty"`       // "Flag which defines if the entity should be enabled when first added."
	Encoding               *string `json:"encoding,omitempty"`                 // "The encoding of the payloads received. Set to `\"\"` to disable decoding of incoming payload. Use `image_encoding` to enable `Base64` decoding on `topic`."
	EntityCategory         *string `json:"entity_category,omitempty"`          // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity."
	Icon                   *string `json:"icon,omitempty"`                     // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity."
	ImageEncoding          *string `json:"image_encoding,omitempty"`           // "The encoding of the image payloads received. Set to `\"b64\"` to enable base64 decoding of image payload. If not set, the image payload must be raw binary data."
	JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`."
	JsonAttributesTopic    *string `json:"json_attributes_topic,omitempty"`    // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Implies `force_update` of the current sensor state when a message is received on this topic."

	Name       *string `json:"name,omitempty"`      // "The name of the camera."
	ObjectId   *string `json:"object_id,omitempty"` // "Used instead of `name` for automatic generation of `entity_id`"
	StateTopic *string `json:"topic,omitempty"`     // "The MQTT topic to subscribe to."

	UniqueId *string     `json:"unique_id,omitempty"` // "An ID that uniquely identifies this camera. If two cameras have the same unique ID Home Assistant will raise an exception."
	MQTT     *MQTTFields `json:"-"`                   // MQTT configuration parameters

	States *CameraState `json:"-"` // External state update location
	// contains filtered or unexported fields
}

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewCamera added in v0.2.0

func NewCamera(o *CameraOptions) (*Camera, error)

func (*Camera) AddMessageHandler

func (d *Camera) AddMessageHandler()

func (*Camera) AnnounceAvailable

func (d *Camera) AnnounceAvailable()

func (*Camera) DeleteTopic

func (d *Camera) DeleteTopic()

func (*Camera) GetDomainEntity added in v0.2.3

func (d *Camera) GetDomainEntity() string

func (*Camera) GetMQTTFields

func (d *Camera) GetMQTTFields() (fields MQTTFields)

func (*Camera) GetName

func (d *Camera) GetName() string

func (*Camera) GetRawId

func (d *Camera) GetRawId() string

func (*Camera) GetUniqueId

func (d *Camera) GetUniqueId() string

func (*Camera) Initialize

func (d *Camera) Initialize()

func (*Camera) JsonAttributes added in v0.2.1

func (d *Camera) JsonAttributes(s string)

func (*Camera) PopulateDevice

func (d *Camera) PopulateDevice(Manufacturer string, SoftwareName string, InstanceName string, SWVersion string, Identifier string)

func (*Camera) SetMQTTFields

func (d *Camera) SetMQTTFields(fields MQTTFields)

func (*Camera) State added in v0.2.1

func (d *Camera) State(s string)

func (*Camera) Subscribe

func (d *Camera) Subscribe()

func (*Camera) UnSubscribe

func (d *Camera) UnSubscribe()

func (*Camera) UpdateState

func (d *Camera) UpdateState()

type CameraOptions added in v0.2.0

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

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewCameraOptions added in v0.2.0

func NewCameraOptions() *CameraOptions

func (*CameraOptions) AvailabilityFunc added in v0.2.0

func (o *CameraOptions) AvailabilityFunc(f func() string) *CameraOptions

func (*CameraOptions) AvailabilityMode added in v0.2.0

func (o *CameraOptions) AvailabilityMode(mode string) *CameraOptions

func (*CameraOptions) AvailabilityTemplate added in v0.2.0

func (o *CameraOptions) AvailabilityTemplate(template string) *CameraOptions

func (*CameraOptions) EnabledByDefault added in v0.2.0

func (o *CameraOptions) EnabledByDefault(d bool) *CameraOptions

func (*CameraOptions) Encoding added in v0.2.0

func (o *CameraOptions) Encoding(encoding string) *CameraOptions

func (*CameraOptions) EntityCategory added in v0.2.0

func (o *CameraOptions) EntityCategory(category string) *CameraOptions

func (*CameraOptions) Icon added in v0.2.0

func (o *CameraOptions) Icon(icon string) *CameraOptions

func (*CameraOptions) ImageEncoding added in v0.2.0

func (o *CameraOptions) ImageEncoding(encoding string) *CameraOptions

func (*CameraOptions) JsonAttributesFunc added in v0.2.0

func (o *CameraOptions) JsonAttributesFunc(f func() string) *CameraOptions

func (*CameraOptions) JsonAttributesTemplate added in v0.2.0

func (o *CameraOptions) JsonAttributesTemplate(template string) *CameraOptions

func (*CameraOptions) Name added in v0.2.0

func (o *CameraOptions) Name(name string) *CameraOptions

func (*CameraOptions) ObjectId added in v0.2.0

func (o *CameraOptions) ObjectId(id string) *CameraOptions

func (*CameraOptions) StateFunc added in v0.2.0

func (o *CameraOptions) StateFunc(f func() string) *CameraOptions

func (*CameraOptions) States added in v0.2.0

func (o *CameraOptions) States() *CameraState

func (*CameraOptions) UniqueId added in v0.2.0

func (o *CameraOptions) UniqueId(id string) *CameraOptions

type CameraState added in v0.2.0

type CameraState struct {
	JsonAttributes string
	State          string
}

type Climate

type Climate struct {
	ActionTemplate *string `json:"action_template,omitempty"` // "A template to render the value received on the `action_topic` with."
	ActionTopic    *string `json:"action_topic,omitempty"`    // "The MQTT topic to subscribe for changes of the current action. If this is set, the climate graph uses the value received as data source. Valid values: `off`, `heating`, `cooling`, `drying`, `idle`, `fan`."

	AuxCommandTopic *string `json:"aux_command_topic,omitempty"` // "The MQTT topic to publish commands to switch auxiliary heat."

	AuxStateTemplate *string `json:"aux_state_template,omitempty"` // "A template to render the value received on the `aux_state_topic` with."
	AuxStateTopic    *string `json:"aux_state_topic,omitempty"`    // "The MQTT topic to subscribe for changes of the auxiliary heat mode. If this is not set, the auxiliary heat mode works in optimistic mode (see below)."

	AvailabilityMode     *string `json:"availability_mode,omitempty"`     // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability."
	AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`."
	AvailabilityTopic    *string `json:"availability_topic,omitempty"`    // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`."

	CurrentHumidityTemplate *string `json:"current_humidity_template,omitempty"` // "A template with which the value received on `current_humidity_topic` will be rendered."
	CurrentHumidityTopic    *string `json:"current_humidity_topic,omitempty"`    // "The MQTT topic on which to listen for the current humidity. A `\"None\"` value received will reset the current temperature. Empty values (`”'`) will be ignored."

	CurrentTemperatureTemplate *string `json:"current_temperature_template,omitempty"` // "A template with which the value received on `current_temperature_topic` will be rendered."
	CurrentTemperatureTopic    *string `json:"current_temperature_topic,omitempty"`    // "The MQTT topic on which to listen for the current temperature. A `\"None\"` value received will reset the current humidity. Empty values (`”'`) will be ignored."

	Device                 Device  `json:"device,omitempty"`                    // Device configuration parameters
	EnabledByDefault       *bool   `json:"enabled_by_default,omitempty"`        // "Flag which defines if the entity should be enabled when first added."
	Encoding               *string `json:"encoding,omitempty"`                  // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload."
	EntityCategory         *string `json:"entity_category,omitempty"`           // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity."
	FanModeCommandTemplate *string `json:"fan_mode_command_template,omitempty"` // "A template to render the value sent to the `fan_mode_command_topic` with."
	FanModeCommandTopic    *string `json:"fan_mode_command_topic,omitempty"`    // "The MQTT topic to publish commands to change the fan mode."

	FanModeStateTemplate *string `json:"fan_mode_state_template,omitempty"` // "A template to render the value received on the `fan_mode_state_topic` with."
	FanModeStateTopic    *string `json:"fan_mode_state_topic,omitempty"`    // "The MQTT topic to subscribe for changes of the HVAC fan mode. If this is not set, the fan mode works in optimistic mode (see below)."

	FanModes               *([]string) `json:"fan_modes,omitempty"`                // "A list of supported fan modes."
	Icon                   *string     `json:"icon,omitempty"`                     // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity."
	Initial                *int        `json:"initial,omitempty"`                  // "Set the initial target temperature."
	JsonAttributesTemplate *string     `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation."
	JsonAttributesTopic    *string     `json:"json_attributes_topic,omitempty"`    // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation."

	MaxHumidity         *int     `json:"max_humidity,omitempty"`          // "The minimum target humidity percentage that can be set."
	MaxTemp             *float64 `json:"max_temp,omitempty"`              // "Maximum set point available."
	MinHumidity         *int     `json:"min_humidity,omitempty"`          // "The maximum target humidity percentage that can be set."
	MinTemp             *float64 `json:"min_temp,omitempty"`              // "Minimum set point available."
	ModeCommandTemplate *string  `json:"mode_command_template,omitempty"` // "A template to render the value sent to the `mode_command_topic` with."
	ModeCommandTopic    *string  `json:"mode_command_topic,omitempty"`    // "The MQTT topic to publish commands to change the HVAC operation mode. Use with `mode_command_template` if you only want to publish the power state."

	ModeStateTemplate *string `json:"mode_state_template,omitempty"` // "A template to render the value received on the `mode_state_topic` with."
	ModeStateTopic    *string `json:"mode_state_topic,omitempty"`    // "The MQTT topic to subscribe for changes of the HVAC operation mode. If this is not set, the operation mode works in optimistic mode (see below)."

	Modes                     *([]string) `json:"modes,omitempty"`                        // "A list of supported modes. Needs to be a subset of the default values."
	Name                      *string     `json:"name,omitempty"`                         // "The name of the HVAC."
	ObjectId                  *string     `json:"object_id,omitempty"`                    // "Used instead of `name` for automatic generation of `entity_id`"
	Optimistic                *bool       `json:"optimistic,omitempty"`                   // "Flag that defines if the climate works in optimistic mode"
	PayloadAvailable          *string     `json:"payload_available,omitempty"`            // "The payload that represents the available state."
	PayloadNotAvailable       *string     `json:"payload_not_available,omitempty"`        // "The payload that represents the unavailable state."
	PayloadOff                *string     `json:"payload_off,omitempty"`                  // "The payload that represents disabled state."
	PayloadOn                 *string     `json:"payload_on,omitempty"`                   // "The payload that represents enabled state."
	Precision                 *float64    `json:"precision,omitempty"`                    // "The desired precision for this device. Can be used to match your actual thermostat's precision. Supported values are `0.1`, `0.5` and `1.0`."
	PresetModeCommandTemplate *string     `json:"preset_mode_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `preset_mode_command_topic`."
	PresetModeCommandTopic    *string     `json:"preset_mode_command_topic,omitempty"`    // "The MQTT topic to publish commands to change the preset mode."

	PresetModeStateTopic *string `json:"preset_mode_state_topic,omitempty"` // "The MQTT topic subscribed to receive climate speed based on presets. When preset 'none' is received or `None` the `preset_mode` will be reset."

	PresetModeValueTemplate  *string     `json:"preset_mode_value_template,omitempty"`  // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the `preset_mode` value from the payload received on `preset_mode_state_topic`."
	PresetModes              *([]string) `json:"preset_modes,omitempty"`                // "List of preset modes this climate is supporting. Common examples include `eco`, `away`, `boost`, `comfort`, `home`, `sleep` and `activity`."
	Qos                      *int        `json:"qos,omitempty"`                         // "The maximum QoS level to be used when receiving and publishing messages."
	Retain                   *bool       `json:"retain,omitempty"`                      // "Defines if published messages should have the retain flag set."
	SwingModeCommandTemplate *string     `json:"swing_mode_command_template,omitempty"` // "A template to render the value sent to the `swing_mode_command_topic` with."
	SwingModeCommandTopic    *string     `json:"swing_mode_command_topic,omitempty"`    // "The MQTT topic to publish commands to change the swing mode."

	SwingModeStateTemplate *string `json:"swing_mode_state_template,omitempty"` // "A template to render the value received on the `swing_mode_state_topic` with."
	SwingModeStateTopic    *string `json:"swing_mode_state_topic,omitempty"`    // "The MQTT topic to subscribe for changes of the HVAC swing mode. If this is not set, the swing mode works in optimistic mode (see below)."

	SwingModes                    *([]string) `json:"swing_modes,omitempty"`                      // "A list of supported swing modes."
	TargetHumidityCommandTemplate *string     `json:"target_humidity_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `target_humidity_command_topic`."
	TargetHumidityCommandTopic    *string     `json:"target_humidity_command_topic,omitempty"`    // "The MQTT topic to publish commands to change the target humidity."

	TargetHumidityStateTemplate *string `json:"target_humidity_state_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract a value for the climate `target_humidity` state."
	TargetHumidityStateTopic    *string `json:"target_humidity_state_topic,omitempty"`    // "The MQTT topic subscribed to receive the target humidity. If this is not set, the target humidity works in optimistic mode (see below). A `\"None\"` value received will reset the target humidity. Empty values (`”'`) will be ignored."

	TempStep                   *float64 `json:"temp_step,omitempty"`                    // "Step size for temperature set point."
	TemperatureCommandTemplate *string  `json:"temperature_command_template,omitempty"` // "A template to render the value sent to the `temperature_command_topic` with."
	TemperatureCommandTopic    *string  `json:"temperature_command_topic,omitempty"`    // "The MQTT topic to publish commands to change the target temperature."

	TemperatureHighCommandTemplate *string `json:"temperature_high_command_template,omitempty"` // "A template to render the value sent to the `temperature_high_command_topic` with."
	TemperatureHighCommandTopic    *string `json:"temperature_high_command_topic,omitempty"`    // "The MQTT topic to publish commands to change the high target temperature."

	TemperatureHighStateTemplate *string `json:"temperature_high_state_template,omitempty"` // "A template to render the value received on the `temperature_high_state_topic` with. A `\"None\"` value received will reset the temperature high set point. Empty values (`”'`) will be ignored."
	TemperatureHighStateTopic    *string `json:"temperature_high_state_topic,omitempty"`    // "The MQTT topic to subscribe for changes in the target high temperature. If this is not set, the target high temperature works in optimistic mode (see below)."

	TemperatureLowCommandTemplate *string `json:"temperature_low_command_template,omitempty"` // "A template to render the value sent to the `temperature_low_command_topic` with."
	TemperatureLowCommandTopic    *string `json:"temperature_low_command_topic,omitempty"`    // "The MQTT topic to publish commands to change the target low temperature."

	TemperatureLowStateTemplate *string `json:"temperature_low_state_template,omitempty"` // "A template to render the value received on the `temperature_low_state_topic` with. A `\"None\"` value received will reset the temperature low set point. Empty values (`”'`) will be ignored."
	TemperatureLowStateTopic    *string `json:"temperature_low_state_topic,omitempty"`    // "The MQTT topic to subscribe for changes in the target low temperature. If this is not set, the target low temperature works in optimistic mode (see below)."

	TemperatureStateTemplate *string `json:"temperature_state_template,omitempty"` // "A template to render the value received on the `temperature_state_topic` with."
	TemperatureStateTopic    *string `json:"temperature_state_topic,omitempty"`    // "The MQTT topic to subscribe for changes in the target temperature. If this is not set, the target temperature works in optimistic mode (see below). A `\"None\"` value received will reset the temperature set point. Empty values (`”'`) will be ignored."

	TemperatureUnit *string     `json:"temperature_unit,omitempty"` // "Defines the temperature unit of the device, `C` or `F`. If this is not set, the temperature unit is set to the system temperature unit."
	UniqueId        *string     `json:"unique_id,omitempty"`        // "An ID that uniquely identifies this HVAC device. If two HVAC devices have the same unique ID, Home Assistant will raise an exception."
	ValueTemplate   *string     `json:"value_template,omitempty"`   // "Default template to render the payloads on *all* `*_state_topic`s with."
	MQTT            *MQTTFields `json:"-"`                          // MQTT configuration parameters

	States *ClimateState `json:"-"` // External state update location
	// contains filtered or unexported fields
}

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewClimate added in v0.2.0

func NewClimate(o *ClimateOptions) (*Climate, error)

func (*Climate) AddMessageHandler

func (d *Climate) AddMessageHandler()

func (*Climate) AnnounceAvailable

func (d *Climate) AnnounceAvailable()

func (*Climate) Aux added in v0.2.1

func (d *Climate) Aux(s string)

func (*Climate) CurrentHumidity added in v0.2.1

func (d *Climate) CurrentHumidity(s string)

func (*Climate) CurrentTemperature added in v0.2.1

func (d *Climate) CurrentTemperature(s string)

func (*Climate) DeleteTopic

func (d *Climate) DeleteTopic()

func (*Climate) FanMode added in v0.2.1

func (d *Climate) FanMode(s string)

func (*Climate) GetDomainEntity added in v0.2.3

func (d *Climate) GetDomainEntity() string

func (*Climate) GetMQTTFields

func (d *Climate) GetMQTTFields() (fields MQTTFields)

func (*Climate) GetName

func (d *Climate) GetName() string

func (*Climate) GetRawId

func (d *Climate) GetRawId() string

func (*Climate) GetUniqueId

func (d *Climate) GetUniqueId() string

func (*Climate) Initialize

func (d *Climate) Initialize()

func (*Climate) JsonAttributes added in v0.2.1

func (d *Climate) JsonAttributes(s string)

func (*Climate) Mode added in v0.2.1

func (d *Climate) Mode(s string)

func (*Climate) PopulateDevice

func (d *Climate) PopulateDevice(Manufacturer string, SoftwareName string, InstanceName string, SWVersion string, Identifier string)

func (*Climate) PresetMode added in v0.2.1

func (d *Climate) PresetMode(s string)

func (*Climate) SetMQTTFields

func (d *Climate) SetMQTTFields(fields MQTTFields)

func (*Climate) Subscribe

func (d *Climate) Subscribe()

func (*Climate) SwingMode added in v0.2.1

func (d *Climate) SwingMode(s string)

func (*Climate) TargetHumidity added in v0.2.1

func (d *Climate) TargetHumidity(s string)

func (*Climate) Temperature added in v0.2.1

func (d *Climate) Temperature(s string)

func (*Climate) TemperatureHigh added in v0.2.1

func (d *Climate) TemperatureHigh(s string)

func (*Climate) TemperatureLow added in v0.2.1

func (d *Climate) TemperatureLow(s string)

func (*Climate) UnSubscribe

func (d *Climate) UnSubscribe()

func (*Climate) UpdateState

func (d *Climate) UpdateState()

type ClimateOptions added in v0.2.0

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

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewClimateOptions added in v0.2.0

func NewClimateOptions() *ClimateOptions

func (*ClimateOptions) ActionFunc added in v0.2.0

func (o *ClimateOptions) ActionFunc(f func(mqtt.Message, mqtt.Client)) *ClimateOptions

func (*ClimateOptions) ActionTemplate added in v0.2.0

func (o *ClimateOptions) ActionTemplate(template string) *ClimateOptions

func (*ClimateOptions) AuxCommandFunc added in v0.2.0

func (o *ClimateOptions) AuxCommandFunc(f func(mqtt.Message, mqtt.Client)) *ClimateOptions

func (*ClimateOptions) AuxStateFunc added in v0.2.0

func (o *ClimateOptions) AuxStateFunc(f func() string) *ClimateOptions

func (*ClimateOptions) AuxStateTemplate added in v0.2.0

func (o *ClimateOptions) AuxStateTemplate(template string) *ClimateOptions

func (*ClimateOptions) AvailabilityFunc added in v0.2.0

func (o *ClimateOptions) AvailabilityFunc(f func() string) *ClimateOptions

func (*ClimateOptions) AvailabilityMode added in v0.2.0

func (o *ClimateOptions) AvailabilityMode(mode string) *ClimateOptions

func (*ClimateOptions) AvailabilityTemplate added in v0.2.0

func (o *ClimateOptions) AvailabilityTemplate(template string) *ClimateOptions

func (*ClimateOptions) CurrentHumidityFunc added in v0.2.0

func (o *ClimateOptions) CurrentHumidityFunc(f func() string) *ClimateOptions

func (*ClimateOptions) CurrentHumidityTemplate added in v0.2.0

func (o *ClimateOptions) CurrentHumidityTemplate(template string) *ClimateOptions

func (*ClimateOptions) CurrentTemperatureFunc added in v0.2.0

func (o *ClimateOptions) CurrentTemperatureFunc(f func() string) *ClimateOptions

func (*ClimateOptions) CurrentTemperatureTemplate added in v0.2.0

func (o *ClimateOptions) CurrentTemperatureTemplate(template string) *ClimateOptions

func (*ClimateOptions) EnableAux added in v0.2.1

func (o *ClimateOptions) EnableAux() *ClimateOptions

func (*ClimateOptions) EnableFanMode added in v0.2.1

func (o *ClimateOptions) EnableFanMode() *ClimateOptions

func (*ClimateOptions) EnableMode added in v0.2.1

func (o *ClimateOptions) EnableMode() *ClimateOptions

func (*ClimateOptions) EnablePresetMode added in v0.2.1

func (o *ClimateOptions) EnablePresetMode() *ClimateOptions

func (*ClimateOptions) EnableSwingMode added in v0.2.1

func (o *ClimateOptions) EnableSwingMode() *ClimateOptions

func (*ClimateOptions) EnableTargetHumidity added in v0.2.1

func (o *ClimateOptions) EnableTargetHumidity() *ClimateOptions

func (*ClimateOptions) EnableTemperature added in v0.2.1

func (o *ClimateOptions) EnableTemperature() *ClimateOptions

func (*ClimateOptions) EnableTemperatureHigh added in v0.2.1

func (o *ClimateOptions) EnableTemperatureHigh() *ClimateOptions

func (*ClimateOptions) EnableTemperatureLow added in v0.2.1

func (o *ClimateOptions) EnableTemperatureLow() *ClimateOptions

func (*ClimateOptions) EnabledByDefault added in v0.2.0

func (o *ClimateOptions) EnabledByDefault(d bool) *ClimateOptions

func (*ClimateOptions) Encoding added in v0.2.0

func (o *ClimateOptions) Encoding(encoding string) *ClimateOptions

func (*ClimateOptions) EntityCategory added in v0.2.0

func (o *ClimateOptions) EntityCategory(category string) *ClimateOptions

func (*ClimateOptions) FanModeCommandFunc added in v0.2.0

func (o *ClimateOptions) FanModeCommandFunc(f func(mqtt.Message, mqtt.Client)) *ClimateOptions

func (*ClimateOptions) FanModeCommandTemplate added in v0.2.0

func (o *ClimateOptions) FanModeCommandTemplate(template string) *ClimateOptions

func (*ClimateOptions) FanModeStateFunc added in v0.2.0

func (o *ClimateOptions) FanModeStateFunc(f func() string) *ClimateOptions

func (*ClimateOptions) FanModeStateTemplate added in v0.2.0

func (o *ClimateOptions) FanModeStateTemplate(template string) *ClimateOptions

func (*ClimateOptions) FanModes added in v0.2.0

func (o *ClimateOptions) FanModes(modes []string) *ClimateOptions

func (*ClimateOptions) Icon added in v0.2.0

func (o *ClimateOptions) Icon(icon string) *ClimateOptions

func (*ClimateOptions) Initial added in v0.2.0

func (o *ClimateOptions) Initial(initial int) *ClimateOptions

func (*ClimateOptions) JsonAttributesFunc added in v0.2.0

func (o *ClimateOptions) JsonAttributesFunc(f func() string) *ClimateOptions

func (*ClimateOptions) JsonAttributesTemplate added in v0.2.0

func (o *ClimateOptions) JsonAttributesTemplate(template string) *ClimateOptions

func (*ClimateOptions) MaxHumidity added in v0.2.0

func (o *ClimateOptions) MaxHumidity(humidity int) *ClimateOptions

func (*ClimateOptions) MaxTemp added in v0.2.0

func (o *ClimateOptions) MaxTemp(temp float64) *ClimateOptions

func (*ClimateOptions) MinHumidity added in v0.2.0

func (o *ClimateOptions) MinHumidity(humidity int) *ClimateOptions

func (*ClimateOptions) MinTemp added in v0.2.0

func (o *ClimateOptions) MinTemp(temp float64) *ClimateOptions

func (*ClimateOptions) ModeCommandFunc added in v0.2.0

func (o *ClimateOptions) ModeCommandFunc(f func(mqtt.Message, mqtt.Client)) *ClimateOptions

func (*ClimateOptions) ModeCommandTemplate added in v0.2.0

func (o *ClimateOptions) ModeCommandTemplate(template string) *ClimateOptions

func (*ClimateOptions) ModeStateFunc added in v0.2.0

func (o *ClimateOptions) ModeStateFunc(f func() string) *ClimateOptions

func (*ClimateOptions) ModeStateTemplate added in v0.2.0

func (o *ClimateOptions) ModeStateTemplate(template string) *ClimateOptions

func (*ClimateOptions) Modes added in v0.2.0

func (o *ClimateOptions) Modes(modes []string) *ClimateOptions

func (*ClimateOptions) Name added in v0.2.0

func (o *ClimateOptions) Name(name string) *ClimateOptions

func (*ClimateOptions) ObjectId added in v0.2.0

func (o *ClimateOptions) ObjectId(id string) *ClimateOptions

func (*ClimateOptions) Optimistic added in v0.2.0

func (o *ClimateOptions) Optimistic(optimistic bool) *ClimateOptions

func (*ClimateOptions) PayloadAvailable added in v0.2.0

func (o *ClimateOptions) PayloadAvailable(available string) *ClimateOptions

func (*ClimateOptions) PayloadNotAvailable added in v0.2.0

func (o *ClimateOptions) PayloadNotAvailable(available string) *ClimateOptions

func (*ClimateOptions) PayloadOff added in v0.2.0

func (o *ClimateOptions) PayloadOff(off string) *ClimateOptions

func (*ClimateOptions) PayloadOn added in v0.2.0

func (o *ClimateOptions) PayloadOn(on string) *ClimateOptions

func (*ClimateOptions) Precision added in v0.2.0

func (o *ClimateOptions) Precision(precision float64) *ClimateOptions

func (*ClimateOptions) PresetModeCommandFunc added in v0.2.0

func (o *ClimateOptions) PresetModeCommandFunc(f func(mqtt.Message, mqtt.Client)) *ClimateOptions

func (*ClimateOptions) PresetModeCommandTemplate added in v0.2.0

func (o *ClimateOptions) PresetModeCommandTemplate(template string) *ClimateOptions

func (*ClimateOptions) PresetModeStateFunc added in v0.2.0

func (o *ClimateOptions) PresetModeStateFunc(f func() string) *ClimateOptions

func (*ClimateOptions) PresetModeValueTemplate added in v0.2.0

func (o *ClimateOptions) PresetModeValueTemplate(template string) *ClimateOptions

func (*ClimateOptions) PresetModes added in v0.2.0

func (o *ClimateOptions) PresetModes(modes []string) *ClimateOptions

func (*ClimateOptions) Qos added in v0.2.0

func (o *ClimateOptions) Qos(qos int) *ClimateOptions

func (*ClimateOptions) Retain added in v0.2.0

func (o *ClimateOptions) Retain(retain bool) *ClimateOptions

func (*ClimateOptions) States added in v0.2.0

func (o *ClimateOptions) States() *ClimateState

func (*ClimateOptions) SwingModeCommandFunc added in v0.2.0

func (o *ClimateOptions) SwingModeCommandFunc(f func(mqtt.Message, mqtt.Client)) *ClimateOptions

func (*ClimateOptions) SwingModeCommandTemplate added in v0.2.0

func (o *ClimateOptions) SwingModeCommandTemplate(template string) *ClimateOptions

func (*ClimateOptions) SwingModeStateFunc added in v0.2.0

func (o *ClimateOptions) SwingModeStateFunc(f func() string) *ClimateOptions

func (*ClimateOptions) SwingModeStateTemplate added in v0.2.0

func (o *ClimateOptions) SwingModeStateTemplate(template string) *ClimateOptions

func (*ClimateOptions) SwingModes added in v0.2.0

func (o *ClimateOptions) SwingModes(modes []string) *ClimateOptions

func (*ClimateOptions) TargetHumidityCommandFunc added in v0.2.0

func (o *ClimateOptions) TargetHumidityCommandFunc(f func(mqtt.Message, mqtt.Client)) *ClimateOptions

func (*ClimateOptions) TargetHumidityCommandTemplate added in v0.2.0

func (o *ClimateOptions) TargetHumidityCommandTemplate(template string) *ClimateOptions

func (*ClimateOptions) TargetHumidityStateFunc added in v0.2.0

func (o *ClimateOptions) TargetHumidityStateFunc(f func() string) *ClimateOptions

func (*ClimateOptions) TargetHumidityStateTemplate added in v0.2.0

func (o *ClimateOptions) TargetHumidityStateTemplate(template string) *ClimateOptions

func (*ClimateOptions) TempStep added in v0.2.0

func (o *ClimateOptions) TempStep(step float64) *ClimateOptions

func (*ClimateOptions) TemperatureCommandFunc added in v0.2.0

func (o *ClimateOptions) TemperatureCommandFunc(f func(mqtt.Message, mqtt.Client)) *ClimateOptions

func (*ClimateOptions) TemperatureCommandTemplate added in v0.2.0

func (o *ClimateOptions) TemperatureCommandTemplate(template string) *ClimateOptions

func (*ClimateOptions) TemperatureHighCommandFunc added in v0.2.0

func (o *ClimateOptions) TemperatureHighCommandFunc(f func(mqtt.Message, mqtt.Client)) *ClimateOptions

func (*ClimateOptions) TemperatureHighCommandTemplate added in v0.2.0

func (o *ClimateOptions) TemperatureHighCommandTemplate(template string) *ClimateOptions

func (*ClimateOptions) TemperatureHighStateFunc added in v0.2.0

func (o *ClimateOptions) TemperatureHighStateFunc(f func() string) *ClimateOptions

func (*ClimateOptions) TemperatureHighStateTemplate added in v0.2.0

func (o *ClimateOptions) TemperatureHighStateTemplate(template string) *ClimateOptions

func (*ClimateOptions) TemperatureLowCommandFunc added in v0.2.0

func (o *ClimateOptions) TemperatureLowCommandFunc(f func(mqtt.Message, mqtt.Client)) *ClimateOptions

func (*ClimateOptions) TemperatureLowCommandTemplate added in v0.2.0

func (o *ClimateOptions) TemperatureLowCommandTemplate(template string) *ClimateOptions

func (*ClimateOptions) TemperatureLowStateFunc added in v0.2.0

func (o *ClimateOptions) TemperatureLowStateFunc(f func() string) *ClimateOptions

func (*ClimateOptions) TemperatureLowStateTemplate added in v0.2.0

func (o *ClimateOptions) TemperatureLowStateTemplate(template string) *ClimateOptions

func (*ClimateOptions) TemperatureStateFunc added in v0.2.0

func (o *ClimateOptions) TemperatureStateFunc(f func() string) *ClimateOptions

func (*ClimateOptions) TemperatureStateTemplate added in v0.2.0

func (o *ClimateOptions) TemperatureStateTemplate(template string) *ClimateOptions

func (*ClimateOptions) TemperatureUnit added in v0.2.0

func (o *ClimateOptions) TemperatureUnit(unit string) *ClimateOptions

func (*ClimateOptions) UniqueId added in v0.2.0

func (o *ClimateOptions) UniqueId(id string) *ClimateOptions

func (*ClimateOptions) ValueTemplate added in v0.2.0

func (o *ClimateOptions) ValueTemplate(template string) *ClimateOptions

type ClimateState added in v0.2.0

type ClimateState struct {
	Aux                string
	CurrentHumidity    string
	CurrentTemperature string
	FanMode            string
	JsonAttributes     string
	Mode               string
	PresetMode         string
	SwingMode          string
	TargetHumidity     string
	TemperatureHigh    string
	TemperatureLow     string
	Temperature        string
}

type Device added in v0.2.0

type Device struct {
	ConfigurationUrl *string `json:"configuration_url,omitempty"`
	Connections      *string `json:"connections,omitempty"`
	Identifiers      *string `json:"identifiers,omitempty"`
	Manufacturer     *string `json:"manufacturer,omitempty"`
	Model            *string `json:"model,omitempty"`
	Name             *string `json:"name,omitempty"`
	SuggestedArea    *string `json:"suggested_area,omitempty"`
	SwVersion        *string `json:"sw_version,omitempty"`
	ViaDevice        *string `json:"via_device,omitempty"`
}

type DeviceTracker

type DeviceTracker struct {
	AvailabilityMode     *string `json:"availability_mode,omitempty"`     // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability."
	AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`."
	AvailabilityTopic    *string `json:"availability_topic,omitempty"`    // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`."

	Device                 Device  `json:"device,omitempty"`                   // Device configuration parameters
	Icon                   *string `json:"icon,omitempty"`                     // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity."
	JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation."
	JsonAttributesTopic    *string `json:"json_attributes_topic,omitempty"`    // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as device_tracker attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation."

	Name                *string `json:"name,omitempty"`                  // "The name of the MQTT device_tracker."
	ObjectId            *string `json:"object_id,omitempty"`             // "Used instead of `name` for automatic generation of `entity_id`"
	PayloadAvailable    *string `json:"payload_available,omitempty"`     // "The payload that represents the available state."
	PayloadHome         *string `json:"payload_home,omitempty"`          // "The payload value that represents the 'home' state for the device."
	PayloadNotAvailable *string `json:"payload_not_available,omitempty"` // "The payload that represents the unavailable state."
	PayloadNotHome      *string `json:"payload_not_home,omitempty"`      // "The payload value that represents the 'not_home' state for the device."
	PayloadReset        *string `json:"payload_reset,omitempty"`         // "The payload value that will have the device's location automatically derived from Home Assistant's zones."
	Qos                 *int    `json:"qos,omitempty"`                   // "The maximum QoS level of the state topic."
	SourceType          *string `json:"source_type,omitempty"`           // "Attribute of a device tracker that affects state when being used to track a [person](/integrations/person/). Valid options are `gps`, `router`, `bluetooth`, or `bluetooth_le`."
	StateTopic          *string `json:"state_topic,omitempty"`           // "The MQTT topic subscribed to receive device tracker state changes."

	UniqueId      *string     `json:"unique_id,omitempty"`      // "An ID that uniquely identifies this device_tracker. If two device_trackers have the same unique ID, Home Assistant will raise an exception."
	ValueTemplate *string     `json:"value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) that returns a device tracker state."
	MQTT          *MQTTFields `json:"-"`                        // MQTT configuration parameters

	States *DeviceTrackerState `json:"-"` // External state update location
	// contains filtered or unexported fields
}

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewDeviceTracker added in v0.2.0

func NewDeviceTracker(o *DeviceTrackerOptions) (*DeviceTracker, error)

func (*DeviceTracker) AddMessageHandler

func (d *DeviceTracker) AddMessageHandler()

func (*DeviceTracker) AnnounceAvailable

func (d *DeviceTracker) AnnounceAvailable()

func (*DeviceTracker) DeleteTopic

func (d *DeviceTracker) DeleteTopic()

func (*DeviceTracker) GetDomainEntity added in v0.2.3

func (d *DeviceTracker) GetDomainEntity() string

func (*DeviceTracker) GetMQTTFields

func (d *DeviceTracker) GetMQTTFields() (fields MQTTFields)

func (*DeviceTracker) GetName

func (d *DeviceTracker) GetName() string

func (*DeviceTracker) GetRawId

func (d *DeviceTracker) GetRawId() string

func (*DeviceTracker) GetUniqueId

func (d *DeviceTracker) GetUniqueId() string

func (*DeviceTracker) Initialize

func (d *DeviceTracker) Initialize()

func (*DeviceTracker) JsonAttributes added in v0.2.1

func (d *DeviceTracker) JsonAttributes(s string)

func (*DeviceTracker) PopulateDevice

func (d *DeviceTracker) PopulateDevice(Manufacturer string, SoftwareName string, InstanceName string, SWVersion string, Identifier string)

func (*DeviceTracker) SetMQTTFields

func (d *DeviceTracker) SetMQTTFields(fields MQTTFields)

func (*DeviceTracker) State added in v0.2.1

func (d *DeviceTracker) State(s string)

func (*DeviceTracker) Subscribe

func (d *DeviceTracker) Subscribe()

func (*DeviceTracker) UnSubscribe

func (d *DeviceTracker) UnSubscribe()

func (*DeviceTracker) UpdateState

func (d *DeviceTracker) UpdateState()

type DeviceTrackerOptions added in v0.2.0

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

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewDeviceTrackerOptions added in v0.2.0

func NewDeviceTrackerOptions() *DeviceTrackerOptions

func (*DeviceTrackerOptions) AvailabilityFunc added in v0.2.0

func (o *DeviceTrackerOptions) AvailabilityFunc(f func() string) *DeviceTrackerOptions

func (*DeviceTrackerOptions) AvailabilityMode added in v0.2.0

func (o *DeviceTrackerOptions) AvailabilityMode(mode string) *DeviceTrackerOptions

func (*DeviceTrackerOptions) AvailabilityTemplate added in v0.2.0

func (o *DeviceTrackerOptions) AvailabilityTemplate(template string) *DeviceTrackerOptions

func (*DeviceTrackerOptions) Icon added in v0.2.0

func (*DeviceTrackerOptions) JsonAttributesFunc added in v0.2.0

func (o *DeviceTrackerOptions) JsonAttributesFunc(f func() string) *DeviceTrackerOptions

func (*DeviceTrackerOptions) JsonAttributesTemplate added in v0.2.0

func (o *DeviceTrackerOptions) JsonAttributesTemplate(template string) *DeviceTrackerOptions

func (*DeviceTrackerOptions) Name added in v0.2.0

func (*DeviceTrackerOptions) ObjectId added in v0.2.0

func (*DeviceTrackerOptions) PayloadAvailable added in v0.2.0

func (o *DeviceTrackerOptions) PayloadAvailable(available string) *DeviceTrackerOptions

func (*DeviceTrackerOptions) PayloadHome added in v0.2.0

func (o *DeviceTrackerOptions) PayloadHome(home string) *DeviceTrackerOptions

func (*DeviceTrackerOptions) PayloadNotAvailable added in v0.2.0

func (o *DeviceTrackerOptions) PayloadNotAvailable(available string) *DeviceTrackerOptions

func (*DeviceTrackerOptions) PayloadNotHome added in v0.2.0

func (o *DeviceTrackerOptions) PayloadNotHome(home string) *DeviceTrackerOptions

func (*DeviceTrackerOptions) PayloadReset added in v0.2.0

func (o *DeviceTrackerOptions) PayloadReset(reset string) *DeviceTrackerOptions

func (*DeviceTrackerOptions) Qos added in v0.2.0

func (*DeviceTrackerOptions) SourceType added in v0.2.0

func (*DeviceTrackerOptions) StateFunc added in v0.2.0

func (o *DeviceTrackerOptions) StateFunc(f func() string) *DeviceTrackerOptions

func (*DeviceTrackerOptions) States added in v0.2.0

func (*DeviceTrackerOptions) UniqueId added in v0.2.0

func (*DeviceTrackerOptions) ValueTemplate added in v0.2.0

func (o *DeviceTrackerOptions) ValueTemplate(template string) *DeviceTrackerOptions

type DeviceTrackerState added in v0.2.0

type DeviceTrackerState struct {
	JsonAttributes string
	State          string
}

type DeviceTrigger

type DeviceTrigger struct {
	AutomationType *string `json:"automation_type,omitempty"` // "The type of automation, must be 'trigger'."
	Device         Device  `json:"device,omitempty"`          // Device configuration parameters
	Payload        *string `json:"payload,omitempty"`         // "Optional payload to match the payload being sent over the topic."
	Qos            *int    `json:"qos,omitempty"`             // "The maximum QoS level to be used when receiving messages."
	Subtype        *string `json:"subtype,omitempty"`         // "The subtype of the trigger, e.g. `button_1`. Entries supported by the frontend: `turn_on`, `turn_off`, `button_1`, `button_2`, `button_3`, `button_4`, `button_5`, `button_6`. If set to an unsupported value, will render as `subtype type`, e.g. `left_button pressed` with `type` set to `button_short_press` and `subtype` set to `left_button`"
	StateTopic     *string `json:"topic,omitempty"`           // "The MQTT topic subscribed to receive trigger events."

	Type          *string     `json:"type,omitempty"`           // "The type of the trigger, e.g. `button_short_press`. Entries supported by the frontend: `button_short_press`, `button_short_release`, `button_long_press`, `button_long_release`, `button_double_press`, `button_triple_press`, `button_quadruple_press`, `button_quintuple_press`. If set to an unsupported value, will render as `subtype type`, e.g. `button_1 spammed` with `type` set to `spammed` and `subtype` set to `button_1`"
	ValueTemplate *string     `json:"value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the value."
	MQTT          *MQTTFields `json:"-"`                        // MQTT configuration parameters

	States *DeviceTriggerState `json:"-"` // External state update location
	// contains filtered or unexported fields
}

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewDeviceTrigger added in v0.2.0

func NewDeviceTrigger(o *DeviceTriggerOptions) (*DeviceTrigger, error)

func (*DeviceTrigger) AddMessageHandler

func (d *DeviceTrigger) AddMessageHandler()

func (*DeviceTrigger) AnnounceAvailable

func (d *DeviceTrigger) AnnounceAvailable()

func (*DeviceTrigger) DeleteTopic

func (d *DeviceTrigger) DeleteTopic()

func (DeviceTrigger) GetDomainEntity added in v0.2.3

func (d DeviceTrigger) GetDomainEntity() string

func (*DeviceTrigger) GetMQTTFields

func (d *DeviceTrigger) GetMQTTFields() (fields MQTTFields)

func (DeviceTrigger) GetName

func (d DeviceTrigger) GetName() string

func (*DeviceTrigger) GetRawId

func (d *DeviceTrigger) GetRawId() string

func (DeviceTrigger) GetUniqueId

func (d DeviceTrigger) GetUniqueId() string

func (*DeviceTrigger) Initialize

func (d *DeviceTrigger) Initialize()

func (*DeviceTrigger) PopulateDevice

func (d *DeviceTrigger) PopulateDevice(Manufacturer string, SoftwareName string, InstanceName string, SWVersion string, Identifier string)

func (*DeviceTrigger) SetMQTTFields

func (d *DeviceTrigger) SetMQTTFields(fields MQTTFields)

func (*DeviceTrigger) State added in v0.2.1

func (d *DeviceTrigger) State(s string)

func (*DeviceTrigger) Subscribe

func (d *DeviceTrigger) Subscribe()

func (*DeviceTrigger) UnSubscribe

func (d *DeviceTrigger) UnSubscribe()

func (*DeviceTrigger) UpdateState

func (d *DeviceTrigger) UpdateState()

type DeviceTriggerOptions added in v0.2.0

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

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewDeviceTriggerOptions added in v0.2.0

func NewDeviceTriggerOptions() *DeviceTriggerOptions

func (*DeviceTriggerOptions) AutomationType added in v0.2.0

func (o *DeviceTriggerOptions) AutomationType(t string) *DeviceTriggerOptions

func (*DeviceTriggerOptions) Payload added in v0.2.0

func (o *DeviceTriggerOptions) Payload(payload string) *DeviceTriggerOptions

func (*DeviceTriggerOptions) Qos added in v0.2.0

func (*DeviceTriggerOptions) StateFunc added in v0.2.0

func (o *DeviceTriggerOptions) StateFunc(f func() string) *DeviceTriggerOptions

func (*DeviceTriggerOptions) States added in v0.2.0

func (*DeviceTriggerOptions) Subtype added in v0.2.0

func (o *DeviceTriggerOptions) Subtype(subtype string) *DeviceTriggerOptions

func (*DeviceTriggerOptions) Type added in v0.2.0

func (*DeviceTriggerOptions) ValueTemplate added in v0.2.0

func (o *DeviceTriggerOptions) ValueTemplate(template string) *DeviceTriggerOptions

type DeviceTriggerState added in v0.2.0

type DeviceTriggerState struct {
	State string
}

type Entity

type Entity interface {
	GetRawId() string
	GetUniqueId() string
	GetDomainEntity() string
	GetName() string
	PopulateDevice(Manufacturer string, SoftwareName string, InstanceName string, SWVersion string, Identifier string)
	UpdateState()
	Subscribe()
	UnSubscribe()
	AddMessageHandler()
	DeleteTopic()
	Initialize()
	SetMQTTFields(MQTTFields)
	GetMQTTFields() MQTTFields
}

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

type Fan

type Fan struct {
	AvailabilityMode     *string `json:"availability_mode,omitempty"`     // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability."
	AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`."
	AvailabilityTopic    *string `json:"availability_topic,omitempty"`    // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`."

	CommandTemplate *string `json:"command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `command_topic`."
	CommandTopic    *string `json:"command_topic,omitempty"`    // "The MQTT topic to publish commands to change the fan state."

	Device                 Device  `json:"device,omitempty"`                   // Device configuration parameters
	EnabledByDefault       *bool   `json:"enabled_by_default,omitempty"`       // "Flag which defines if the entity should be enabled when first added."
	Encoding               *string `json:"encoding,omitempty"`                 // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload."
	EntityCategory         *string `json:"entity_category,omitempty"`          // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity."
	Icon                   *string `json:"icon,omitempty"`                     // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity."
	JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation."
	JsonAttributesTopic    *string `json:"json_attributes_topic,omitempty"`    // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation."

	Name                       *string `json:"name,omitempty"`                         // "The name of the fan."
	ObjectId                   *string `json:"object_id,omitempty"`                    // "Used instead of `name` for automatic generation of `entity_id`"
	Optimistic                 *bool   `json:"optimistic,omitempty"`                   // "Flag that defines if fan works in optimistic mode"
	OscillationCommandTemplate *string `json:"oscillation_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `oscillation_command_topic`."
	OscillationCommandTopic    *string `json:"oscillation_command_topic,omitempty"`    // "The MQTT topic to publish commands to change the oscillation state."

	OscillationStateTopic *string `json:"oscillation_state_topic,omitempty"` // "The MQTT topic subscribed to receive oscillation state updates."

	OscillationValueTemplate  *string `json:"oscillation_value_template,omitempty"`  // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract a value from the oscillation."
	PayloadAvailable          *string `json:"payload_available,omitempty"`           // "The payload that represents the available state."
	PayloadNotAvailable       *string `json:"payload_not_available,omitempty"`       // "The payload that represents the unavailable state."
	PayloadOff                *string `json:"payload_off,omitempty"`                 // "The payload that represents the stop state."
	PayloadOn                 *string `json:"payload_on,omitempty"`                  // "The payload that represents the running state."
	PayloadOscillationOff     *string `json:"payload_oscillation_off,omitempty"`     // "The payload that represents the oscillation off state."
	PayloadOscillationOn      *string `json:"payload_oscillation_on,omitempty"`      // "The payload that represents the oscillation on state."
	PayloadResetPercentage    *string `json:"payload_reset_percentage,omitempty"`    // "A special payload that resets the `percentage` state attribute to `None` when received at the `percentage_state_topic`."
	PayloadResetPresetMode    *string `json:"payload_reset_preset_mode,omitempty"`   // "A special payload that resets the `preset_mode` state attribute to `None` when received at the `preset_mode_state_topic`."
	PercentageCommandTemplate *string `json:"percentage_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `percentage_command_topic`."
	PercentageCommandTopic    *string `json:"percentage_command_topic,omitempty"`    // "The MQTT topic to publish commands to change the fan speed state based on a percentage."

	PercentageStateTopic *string `json:"percentage_state_topic,omitempty"` // "The MQTT topic subscribed to receive fan speed based on percentage."

	PercentageValueTemplate   *string `json:"percentage_value_template,omitempty"`    // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the `percentage` value from the payload received on `percentage_state_topic`."
	PresetModeCommandTemplate *string `json:"preset_mode_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `preset_mode_command_topic`."
	PresetModeCommandTopic    *string `json:"preset_mode_command_topic,omitempty"`    // "The MQTT topic to publish commands to change the preset mode."

	PresetModeStateTopic *string `json:"preset_mode_state_topic,omitempty"` // "The MQTT topic subscribed to receive fan speed based on presets."

	PresetModeValueTemplate *string     `json:"preset_mode_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the `preset_mode` value from the payload received on `preset_mode_state_topic`."
	PresetModes             *([]string) `json:"preset_modes,omitempty"`               // "List of preset modes this fan is capable of running at. Common examples include `auto`, `smart`, `whoosh`, `eco` and `breeze`."
	Qos                     *int        `json:"qos,omitempty"`                        // "The maximum QoS level of the state topic."
	Retain                  *bool       `json:"retain,omitempty"`                     // "If the published message should have the retain flag on or not."
	SpeedRangeMax           *int        `json:"speed_range_max,omitempty"`            // "The maximum of numeric output range (representing 100 %). The number of speeds within the `speed_range` / `100` will determine the `percentage_step`."
	SpeedRangeMin           *int        `json:"speed_range_min,omitempty"`            // "The minimum of numeric output range (`off` not included, so `speed_range_min` - `1` represents 0 %). The number of speeds within the speed_range / 100 will determine the `percentage_step`."
	StateTopic              *string     `json:"state_topic,omitempty"`                // "The MQTT topic subscribed to receive state updates."

	StateValueTemplate *string     `json:"state_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract a value from the state."
	UniqueId           *string     `json:"unique_id,omitempty"`            // "An ID that uniquely identifies this fan. If two fans have the same unique ID, Home Assistant will raise an exception."
	MQTT               *MQTTFields `json:"-"`                              // MQTT configuration parameters

	States *FanState `json:"-"` // External state update location
	// contains filtered or unexported fields
}

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewFan added in v0.2.0

func NewFan(o *FanOptions) (*Fan, error)

func (*Fan) AddMessageHandler

func (d *Fan) AddMessageHandler()

func (*Fan) AnnounceAvailable

func (d *Fan) AnnounceAvailable()

func (*Fan) DeleteTopic

func (d *Fan) DeleteTopic()

func (*Fan) GetDomainEntity added in v0.2.3

func (d *Fan) GetDomainEntity() string

func (*Fan) GetMQTTFields

func (d *Fan) GetMQTTFields() (fields MQTTFields)

func (*Fan) GetName

func (d *Fan) GetName() string

func (*Fan) GetRawId

func (d *Fan) GetRawId() string

func (*Fan) GetUniqueId

func (d *Fan) GetUniqueId() string

func (*Fan) Initialize

func (d *Fan) Initialize()

func (*Fan) JsonAttributes added in v0.2.1

func (d *Fan) JsonAttributes(s string)

func (*Fan) Oscillation added in v0.2.1

func (d *Fan) Oscillation(s string)

func (*Fan) Percentage added in v0.2.1

func (d *Fan) Percentage(s string)

func (*Fan) PopulateDevice

func (d *Fan) PopulateDevice(Manufacturer string, SoftwareName string, InstanceName string, SWVersion string, Identifier string)

func (*Fan) PresetMode added in v0.2.1

func (d *Fan) PresetMode(s string)

func (*Fan) SetMQTTFields

func (d *Fan) SetMQTTFields(fields MQTTFields)

func (*Fan) State added in v0.2.1

func (d *Fan) State(s string)

func (*Fan) Subscribe

func (d *Fan) Subscribe()

func (*Fan) UnSubscribe

func (d *Fan) UnSubscribe()

func (*Fan) UpdateState

func (d *Fan) UpdateState()

type FanOptions added in v0.2.0

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

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewFanOptions added in v0.2.0

func NewFanOptions() *FanOptions

func (*FanOptions) AvailabilityFunc added in v0.2.0

func (o *FanOptions) AvailabilityFunc(f func() string) *FanOptions

func (*FanOptions) AvailabilityMode added in v0.2.0

func (o *FanOptions) AvailabilityMode(mode string) *FanOptions

func (*FanOptions) AvailabilityTemplate added in v0.2.0

func (o *FanOptions) AvailabilityTemplate(template string) *FanOptions

func (*FanOptions) CommandFunc added in v0.2.0

func (o *FanOptions) CommandFunc(f func(mqtt.Message, mqtt.Client)) *FanOptions

func (*FanOptions) CommandTemplate added in v0.2.0

func (o *FanOptions) CommandTemplate(template string) *FanOptions

func (*FanOptions) EnableOscillation added in v0.2.1

func (o *FanOptions) EnableOscillation() *FanOptions

func (*FanOptions) EnablePercentage added in v0.2.1

func (o *FanOptions) EnablePercentage() *FanOptions

func (*FanOptions) EnablePresetMode added in v0.2.1

func (o *FanOptions) EnablePresetMode() *FanOptions

func (*FanOptions) EnabledByDefault added in v0.2.0

func (o *FanOptions) EnabledByDefault(d bool) *FanOptions

func (*FanOptions) Encoding added in v0.2.0

func (o *FanOptions) Encoding(encoding string) *FanOptions

func (*FanOptions) EntityCategory added in v0.2.0

func (o *FanOptions) EntityCategory(category string) *FanOptions

func (*FanOptions) Icon added in v0.2.0

func (o *FanOptions) Icon(icon string) *FanOptions

func (*FanOptions) JsonAttributesFunc added in v0.2.0

func (o *FanOptions) JsonAttributesFunc(f func() string) *FanOptions

func (*FanOptions) JsonAttributesTemplate added in v0.2.0

func (o *FanOptions) JsonAttributesTemplate(template string) *FanOptions

func (*FanOptions) Name added in v0.2.0

func (o *FanOptions) Name(name string) *FanOptions

func (*FanOptions) ObjectId added in v0.2.0

func (o *FanOptions) ObjectId(id string) *FanOptions

func (*FanOptions) Optimistic added in v0.2.0

func (o *FanOptions) Optimistic(optimistic bool) *FanOptions

func (*FanOptions) OscillationCommandFunc added in v0.2.0

func (o *FanOptions) OscillationCommandFunc(f func(mqtt.Message, mqtt.Client)) *FanOptions

func (*FanOptions) OscillationCommandTemplate added in v0.2.0

func (o *FanOptions) OscillationCommandTemplate(template string) *FanOptions

func (*FanOptions) OscillationStateFunc added in v0.2.0

func (o *FanOptions) OscillationStateFunc(f func() string) *FanOptions

func (*FanOptions) OscillationValueTemplate added in v0.2.0

func (o *FanOptions) OscillationValueTemplate(template string) *FanOptions

func (*FanOptions) PayloadAvailable added in v0.2.0

func (o *FanOptions) PayloadAvailable(available string) *FanOptions

func (*FanOptions) PayloadNotAvailable added in v0.2.0

func (o *FanOptions) PayloadNotAvailable(available string) *FanOptions

func (*FanOptions) PayloadOff added in v0.2.0

func (o *FanOptions) PayloadOff(off string) *FanOptions

func (*FanOptions) PayloadOn added in v0.2.0

func (o *FanOptions) PayloadOn(on string) *FanOptions

func (*FanOptions) PayloadOscillationOff added in v0.2.0

func (o *FanOptions) PayloadOscillationOff(off string) *FanOptions

func (*FanOptions) PayloadOscillationOn added in v0.2.0

func (o *FanOptions) PayloadOscillationOn(on string) *FanOptions

func (*FanOptions) PayloadResetPercentage added in v0.2.0

func (o *FanOptions) PayloadResetPercentage(percentage string) *FanOptions

func (*FanOptions) PayloadResetPresetMode added in v0.2.0

func (o *FanOptions) PayloadResetPresetMode(mode string) *FanOptions

func (*FanOptions) PercentageCommandFunc added in v0.2.0

func (o *FanOptions) PercentageCommandFunc(f func(mqtt.Message, mqtt.Client)) *FanOptions

func (*FanOptions) PercentageCommandTemplate added in v0.2.0

func (o *FanOptions) PercentageCommandTemplate(template string) *FanOptions

func (*FanOptions) PercentageStateFunc added in v0.2.0

func (o *FanOptions) PercentageStateFunc(f func() string) *FanOptions

func (*FanOptions) PercentageValueTemplate added in v0.2.0

func (o *FanOptions) PercentageValueTemplate(template string) *FanOptions

func (*FanOptions) PresetModeCommandFunc added in v0.2.0

func (o *FanOptions) PresetModeCommandFunc(f func(mqtt.Message, mqtt.Client)) *FanOptions

func (*FanOptions) PresetModeCommandTemplate added in v0.2.0

func (o *FanOptions) PresetModeCommandTemplate(template string) *FanOptions

func (*FanOptions) PresetModeStateFunc added in v0.2.0

func (o *FanOptions) PresetModeStateFunc(f func() string) *FanOptions

func (*FanOptions) PresetModeValueTemplate added in v0.2.0

func (o *FanOptions) PresetModeValueTemplate(template string) *FanOptions

func (*FanOptions) PresetModes added in v0.2.0

func (o *FanOptions) PresetModes(modes []string) *FanOptions

func (*FanOptions) Qos added in v0.2.0

func (o *FanOptions) Qos(qos int) *FanOptions

func (*FanOptions) Retain added in v0.2.0

func (o *FanOptions) Retain(retain bool) *FanOptions

func (*FanOptions) SpeedRangeMax added in v0.2.0

func (o *FanOptions) SpeedRangeMax(max int) *FanOptions

func (*FanOptions) SpeedRangeMin added in v0.2.0

func (o *FanOptions) SpeedRangeMin(min int) *FanOptions

func (*FanOptions) StateFunc added in v0.2.0

func (o *FanOptions) StateFunc(f func() string) *FanOptions

func (*FanOptions) StateValueTemplate added in v0.2.0

func (o *FanOptions) StateValueTemplate(template string) *FanOptions

func (*FanOptions) States added in v0.2.0

func (o *FanOptions) States() *FanState

func (*FanOptions) UniqueId added in v0.2.0

func (o *FanOptions) UniqueId(id string) *FanOptions

type FanState added in v0.2.0

type FanState struct {
	JsonAttributes string
	Oscillation    string
	Percentage     string
	PresetMode     string
	State          string
}

type Humidifier

type Humidifier struct {
	AvailabilityMode     *string `json:"availability_mode,omitempty"`     // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability."
	AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`."
	AvailabilityTopic    *string `json:"availability_topic,omitempty"`    // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`."

	CommandTemplate *string `json:"command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `command_topic`."
	CommandTopic    *string `json:"command_topic,omitempty"`    // "The MQTT topic to publish commands to change the humidifier state."

	Device                 Device  `json:"device,omitempty"`                   // Device configuration parameters
	DeviceClass            *string `json:"device_class,omitempty"`             // "The device class of the MQTT device. Must be either `humidifier` or `dehumidifier`."
	EnabledByDefault       *bool   `json:"enabled_by_default,omitempty"`       // "Flag which defines if the entity should be enabled when first added."
	Encoding               *string `json:"encoding,omitempty"`                 // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload."
	EntityCategory         *string `json:"entity_category,omitempty"`          // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity."
	Icon                   *string `json:"icon,omitempty"`                     // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity."
	JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation."
	JsonAttributesTopic    *string `json:"json_attributes_topic,omitempty"`    // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation."

	MaxHumidity         *int    `json:"max_humidity,omitempty"`          // "The minimum target humidity percentage that can be set."
	MinHumidity         *int    `json:"min_humidity,omitempty"`          // "The maximum target humidity percentage that can be set."
	ModeCommandTemplate *string `json:"mode_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `mode_command_topic`."
	ModeCommandTopic    *string `json:"mode_command_topic,omitempty"`    // "The MQTT topic to publish commands to change the `mode` on the humidifier. This attribute ust be configured together with the `modes` attribute."

	ModeStateTemplate *string `json:"mode_state_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract a value for the humidifier `mode` state."
	ModeStateTopic    *string `json:"mode_state_topic,omitempty"`    // "The MQTT topic subscribed to receive the humidifier `mode`."

	Modes                *([]string) `json:"modes,omitempty"`                  // "List of available modes this humidifier is capable of running at. Common examples include `normal`, `eco`, `away`, `boost`, `comfort`, `home`, `sleep`, `auto` and `baby`. These examples offer built-in translations but other custom modes are allowed as well.  This attribute ust be configured together with the `mode_command_topic` attribute."
	Name                 *string     `json:"name,omitempty"`                   // "The name of the humidifier."
	ObjectId             *string     `json:"object_id,omitempty"`              // "Used instead of `name` for automatic generation of `entity_id`"
	Optimistic           *bool       `json:"optimistic,omitempty"`             // "Flag that defines if humidifier works in optimistic mode"
	PayloadAvailable     *string     `json:"payload_available,omitempty"`      // "The payload that represents the available state."
	PayloadNotAvailable  *string     `json:"payload_not_available,omitempty"`  // "The payload that represents the unavailable state."
	PayloadOff           *string     `json:"payload_off,omitempty"`            // "The payload that represents the stop state."
	PayloadOn            *string     `json:"payload_on,omitempty"`             // "The payload that represents the running state."
	PayloadResetHumidity *string     `json:"payload_reset_humidity,omitempty"` // "A special payload that resets the `target_humidity` state attribute to `None` when received at the `target_humidity_state_topic`."
	PayloadResetMode     *string     `json:"payload_reset_mode,omitempty"`     // "A special payload that resets the `mode` state attribute to `None` when received at the `mode_state_topic`."
	Qos                  *int        `json:"qos,omitempty"`                    // "The maximum QoS level of the state topic."
	Retain               *bool       `json:"retain,omitempty"`                 // "If the published message should have the retain flag on or not."
	StateTopic           *string     `json:"state_topic,omitempty"`            // "The MQTT topic subscribed to receive state updates."

	StateValueTemplate            *string `json:"state_value_template,omitempty"`             // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract a value from the state."
	TargetHumidityCommandTemplate *string `json:"target_humidity_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `target_humidity_command_topic`."
	TargetHumidityCommandTopic    *string `json:"target_humidity_command_topic,omitempty"`    // "The MQTT topic to publish commands to change the humidifier target humidity state based on a percentage."

	TargetHumidityStateTemplate *string `json:"target_humidity_state_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract a value for the humidifier `target_humidity` state."
	TargetHumidityStateTopic    *string `json:"target_humidity_state_topic,omitempty"`    // "The MQTT topic subscribed to receive humidifier target humidity."

	UniqueId *string     `json:"unique_id,omitempty"` // "An ID that uniquely identifies this humidifier. If two humidifiers have the same unique ID, Home Assistant will raise an exception."
	MQTT     *MQTTFields `json:"-"`                   // MQTT configuration parameters

	States *HumidifierState `json:"-"` // External state update location
	// contains filtered or unexported fields
}

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewHumidifier added in v0.2.0

func NewHumidifier(o *HumidifierOptions) (*Humidifier, error)

func (*Humidifier) AddMessageHandler

func (d *Humidifier) AddMessageHandler()

func (*Humidifier) AnnounceAvailable

func (d *Humidifier) AnnounceAvailable()

func (*Humidifier) DeleteTopic

func (d *Humidifier) DeleteTopic()

func (*Humidifier) GetDomainEntity added in v0.2.3

func (d *Humidifier) GetDomainEntity() string

func (*Humidifier) GetMQTTFields

func (d *Humidifier) GetMQTTFields() (fields MQTTFields)

func (*Humidifier) GetName

func (d *Humidifier) GetName() string

func (*Humidifier) GetRawId

func (d *Humidifier) GetRawId() string

func (*Humidifier) GetUniqueId

func (d *Humidifier) GetUniqueId() string

func (*Humidifier) Initialize

func (d *Humidifier) Initialize()

func (*Humidifier) JsonAttributes added in v0.2.1

func (d *Humidifier) JsonAttributes(s string)

func (*Humidifier) Mode added in v0.2.1

func (d *Humidifier) Mode(s string)

func (*Humidifier) PopulateDevice

func (d *Humidifier) PopulateDevice(Manufacturer string, SoftwareName string, InstanceName string, SWVersion string, Identifier string)

func (*Humidifier) SetMQTTFields

func (d *Humidifier) SetMQTTFields(fields MQTTFields)

func (*Humidifier) State added in v0.2.1

func (d *Humidifier) State(s string)

func (*Humidifier) Subscribe

func (d *Humidifier) Subscribe()

func (*Humidifier) TargetHumidity added in v0.2.1

func (d *Humidifier) TargetHumidity(s string)

func (*Humidifier) UnSubscribe

func (d *Humidifier) UnSubscribe()

func (*Humidifier) UpdateState

func (d *Humidifier) UpdateState()

type HumidifierOptions added in v0.2.0

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

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewHumidifierOptions added in v0.2.0

func NewHumidifierOptions() *HumidifierOptions

func (*HumidifierOptions) AvailabilityFunc added in v0.2.0

func (o *HumidifierOptions) AvailabilityFunc(f func() string) *HumidifierOptions

func (*HumidifierOptions) AvailabilityMode added in v0.2.0

func (o *HumidifierOptions) AvailabilityMode(mode string) *HumidifierOptions

func (*HumidifierOptions) AvailabilityTemplate added in v0.2.0

func (o *HumidifierOptions) AvailabilityTemplate(template string) *HumidifierOptions

func (*HumidifierOptions) CommandFunc added in v0.2.0

func (o *HumidifierOptions) CommandFunc(f func(mqtt.Message, mqtt.Client)) *HumidifierOptions

func (*HumidifierOptions) CommandTemplate added in v0.2.0

func (o *HumidifierOptions) CommandTemplate(template string) *HumidifierOptions

func (*HumidifierOptions) DeviceClass added in v0.2.0

func (o *HumidifierOptions) DeviceClass(class string) *HumidifierOptions

func (*HumidifierOptions) EnableMode added in v0.2.1

func (o *HumidifierOptions) EnableMode() *HumidifierOptions

func (*HumidifierOptions) EnableTargetHumidity added in v0.2.1

func (o *HumidifierOptions) EnableTargetHumidity() *HumidifierOptions

func (*HumidifierOptions) EnabledByDefault added in v0.2.0

func (o *HumidifierOptions) EnabledByDefault(d bool) *HumidifierOptions

func (*HumidifierOptions) Encoding added in v0.2.0

func (o *HumidifierOptions) Encoding(encoding string) *HumidifierOptions

func (*HumidifierOptions) EntityCategory added in v0.2.0

func (o *HumidifierOptions) EntityCategory(category string) *HumidifierOptions

func (*HumidifierOptions) Icon added in v0.2.0

func (*HumidifierOptions) JsonAttributesFunc added in v0.2.0

func (o *HumidifierOptions) JsonAttributesFunc(f func() string) *HumidifierOptions

func (*HumidifierOptions) JsonAttributesTemplate added in v0.2.0

func (o *HumidifierOptions) JsonAttributesTemplate(template string) *HumidifierOptions

func (*HumidifierOptions) MaxHumidity added in v0.2.0

func (o *HumidifierOptions) MaxHumidity(humidity int) *HumidifierOptions

func (*HumidifierOptions) MinHumidity added in v0.2.0

func (o *HumidifierOptions) MinHumidity(humidity int) *HumidifierOptions

func (*HumidifierOptions) ModeCommandFunc added in v0.2.0

func (o *HumidifierOptions) ModeCommandFunc(f func(mqtt.Message, mqtt.Client)) *HumidifierOptions

func (*HumidifierOptions) ModeCommandTemplate added in v0.2.0

func (o *HumidifierOptions) ModeCommandTemplate(template string) *HumidifierOptions

func (*HumidifierOptions) ModeStateFunc added in v0.2.0

func (o *HumidifierOptions) ModeStateFunc(f func() string) *HumidifierOptions

func (*HumidifierOptions) ModeStateTemplate added in v0.2.0

func (o *HumidifierOptions) ModeStateTemplate(template string) *HumidifierOptions

func (*HumidifierOptions) Modes added in v0.2.0

func (o *HumidifierOptions) Modes(modes []string) *HumidifierOptions

func (*HumidifierOptions) Name added in v0.2.0

func (*HumidifierOptions) ObjectId added in v0.2.0

func (o *HumidifierOptions) ObjectId(id string) *HumidifierOptions

func (*HumidifierOptions) Optimistic added in v0.2.0

func (o *HumidifierOptions) Optimistic(optimistic bool) *HumidifierOptions

func (*HumidifierOptions) PayloadAvailable added in v0.2.0

func (o *HumidifierOptions) PayloadAvailable(available string) *HumidifierOptions

func (*HumidifierOptions) PayloadNotAvailable added in v0.2.0

func (o *HumidifierOptions) PayloadNotAvailable(available string) *HumidifierOptions

func (*HumidifierOptions) PayloadOff added in v0.2.0

func (o *HumidifierOptions) PayloadOff(off string) *HumidifierOptions

func (*HumidifierOptions) PayloadOn added in v0.2.0

func (o *HumidifierOptions) PayloadOn(on string) *HumidifierOptions

func (*HumidifierOptions) PayloadResetHumidity added in v0.2.0

func (o *HumidifierOptions) PayloadResetHumidity(humidity string) *HumidifierOptions

func (*HumidifierOptions) PayloadResetMode added in v0.2.0

func (o *HumidifierOptions) PayloadResetMode(mode string) *HumidifierOptions

func (*HumidifierOptions) Qos added in v0.2.0

func (*HumidifierOptions) Retain added in v0.2.0

func (o *HumidifierOptions) Retain(retain bool) *HumidifierOptions

func (*HumidifierOptions) StateFunc added in v0.2.0

func (o *HumidifierOptions) StateFunc(f func() string) *HumidifierOptions

func (*HumidifierOptions) StateValueTemplate added in v0.2.0

func (o *HumidifierOptions) StateValueTemplate(template string) *HumidifierOptions

func (*HumidifierOptions) States added in v0.2.0

func (o *HumidifierOptions) States() *HumidifierState

func (*HumidifierOptions) TargetHumidityCommandFunc added in v0.2.0

func (o *HumidifierOptions) TargetHumidityCommandFunc(f func(mqtt.Message, mqtt.Client)) *HumidifierOptions

func (*HumidifierOptions) TargetHumidityCommandTemplate added in v0.2.0

func (o *HumidifierOptions) TargetHumidityCommandTemplate(template string) *HumidifierOptions

func (*HumidifierOptions) TargetHumidityStateFunc added in v0.2.0

func (o *HumidifierOptions) TargetHumidityStateFunc(f func() string) *HumidifierOptions

func (*HumidifierOptions) TargetHumidityStateTemplate added in v0.2.0

func (o *HumidifierOptions) TargetHumidityStateTemplate(template string) *HumidifierOptions

func (*HumidifierOptions) UniqueId added in v0.2.0

func (o *HumidifierOptions) UniqueId(id string) *HumidifierOptions

type HumidifierState added in v0.2.0

type HumidifierState struct {
	JsonAttributes string
	Mode           string
	State          string
	TargetHumidity string
}

type Light

type Light struct {
	AvailabilityMode     *string `json:"availability_mode,omitempty"`     // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability."
	AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`."
	AvailabilityTopic    *string `json:"availability_topic,omitempty"`    // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`."

	BrightnessCommandTemplate *string `json:"brightness_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/) to compose message which will be sent to `brightness_command_topic`. Available variables: `value`."
	BrightnessCommandTopic    *string `json:"brightness_command_topic,omitempty"`    // "The MQTT topic to publish commands to change the light’s brightness."

	BrightnessScale      *int    `json:"brightness_scale,omitempty"`       // "Defines the maximum brightness value (i.e., 100%) of the MQTT device."
	BrightnessStateTopic *string `json:"brightness_state_topic,omitempty"` // "The MQTT topic subscribed to receive brightness state updates."

	BrightnessValueTemplate *string `json:"brightness_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the brightness value."
	ColorModeStateTopic     *string `json:"color_mode_state_topic,omitempty"`    // "The MQTT topic subscribed to receive color mode updates. If this is not configured, `color_mode` will be automatically set according to the last received valid color or color temperature"

	ColorModeValueTemplate   *string `json:"color_mode_value_template,omitempty"`   // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the color mode."
	ColorTempCommandTemplate *string `json:"color_temp_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/) to compose message which will be sent to `color_temp_command_topic`. Available variables: `value`."
	ColorTempCommandTopic    *string `json:"color_temp_command_topic,omitempty"`    // "The MQTT topic to publish commands to change the light’s color temperature state. The color temperature command slider has a range of 153 to 500 mireds (micro reciprocal degrees)."

	ColorTempStateTopic *string `json:"color_temp_state_topic,omitempty"` // "The MQTT topic subscribed to receive color temperature state updates."

	ColorTempValueTemplate *string `json:"color_temp_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the color temperature value."
	CommandTopic           *string `json:"command_topic,omitempty"`             // "The MQTT topic to publish commands to change the switch state."

	Device                Device  `json:"device,omitempty"`                  // Device configuration parameters
	EffectCommandTemplate *string `json:"effect_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/) to compose message which will be sent to `effect_command_topic`. Available variables: `value`."
	EffectCommandTopic    *string `json:"effect_command_topic,omitempty"`    // "The MQTT topic to publish commands to change the light's effect state."

	EffectList       *([]string) `json:"effect_list,omitempty"`        // "The list of effects the light supports."
	EffectStateTopic *string     `json:"effect_state_topic,omitempty"` // "The MQTT topic subscribed to receive effect state updates."

	EffectValueTemplate *string `json:"effect_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the effect value."
	EnabledByDefault    *bool   `json:"enabled_by_default,omitempty"`    // "Flag which defines if the entity should be enabled when first added."
	Encoding            *string `json:"encoding,omitempty"`              // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload."
	EntityCategory      *string `json:"entity_category,omitempty"`       // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity."
	HsCommandTemplate   *string `json:"hs_command_template,omitempty"`   // "Defines a [template](/docs/configuration/templating/) to compose message which will be sent to `hs_command_topic`. Available variables: `hue` and `sat`."
	HsCommandTopic      *string `json:"hs_command_topic,omitempty"`      // "The MQTT topic to publish commands to change the light's color state in HS format (Hue Saturation). Range for Hue: 0° .. 360°, Range of Saturation: 0..100. Note: Brightness is sent separately in the `brightness_command_topic`."

	HsStateTopic *string `json:"hs_state_topic,omitempty"` // "The MQTT topic subscribed to receive color state updates in HS format. The expected payload is the hue and saturation values separated by commas, for example, `359.5,100.0`. Note: Brightness is received separately in the `brightness_state_topic`."

	HsValueTemplate        *string `json:"hs_value_template,omitempty"`        // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the HS value."
	Icon                   *string `json:"icon,omitempty"`                     // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity."
	JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation."
	JsonAttributesTopic    *string `json:"json_attributes_topic,omitempty"`    // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation."

	MaxMireds           *int    `json:"max_mireds,omitempty"`            // "The maximum color temperature in mireds."
	MinMireds           *int    `json:"min_mireds,omitempty"`            // "The minimum color temperature in mireds."
	Name                *string `json:"name,omitempty"`                  // "The name of the light."
	ObjectId            *string `json:"object_id,omitempty"`             // "Used instead of `name` for automatic generation of `entity_id`"
	OnCommandType       *string `json:"on_command_type,omitempty"`       // "Defines when on the payload_on is sent. Using `last` (the default) will send any style (brightness, color, etc) topics first and then a `payload_on` to the `command_topic`. Using `first` will send the `payload_on` and then any style topics. Using `brightness` will only send brightness commands instead of the `payload_on` to turn the light on."
	Optimistic          *bool   `json:"optimistic,omitempty"`            // "Flag that defines if switch works in optimistic mode."
	PayloadAvailable    *string `json:"payload_available,omitempty"`     // "The payload that represents the available state."
	PayloadNotAvailable *string `json:"payload_not_available,omitempty"` // "The payload that represents the unavailable state."
	PayloadOff          *string `json:"payload_off,omitempty"`           // "The payload that represents disabled state."
	PayloadOn           *string `json:"payload_on,omitempty"`            // "The payload that represents enabled state."
	Qos                 *int    `json:"qos,omitempty"`                   // "The maximum QoS level of the state topic."
	Retain              *bool   `json:"retain,omitempty"`                // "If the published message should have the retain flag on or not."
	RgbCommandTemplate  *string `json:"rgb_command_template,omitempty"`  // "Defines a [template](/docs/configuration/templating/) to compose message which will be sent to `rgb_command_topic`. Available variables: `red`, `green` and `blue`."
	RgbCommandTopic     *string `json:"rgb_command_topic,omitempty"`     // "The MQTT topic to publish commands to change the light's RGB state."

	RgbStateTopic *string `json:"rgb_state_topic,omitempty"` // "The MQTT topic subscribed to receive RGB state updates. The expected payload is the RGB values separated by commas, for example, `255,0,127`."

	RgbValueTemplate    *string `json:"rgb_value_template,omitempty"`    // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the RGB value."
	RgbwCommandTemplate *string `json:"rgbw_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/) to compose message which will be sent to `rgbw_command_topic`. Available variables: `red`, `green`, `blue` and `white`."
	RgbwCommandTopic    *string `json:"rgbw_command_topic,omitempty"`    // "The MQTT topic to publish commands to change the light's RGBW state."

	RgbwStateTopic *string `json:"rgbw_state_topic,omitempty"` // "The MQTT topic subscribed to receive RGBW state updates. The expected payload is the RGBW values separated by commas, for example, `255,0,127,64`."

	RgbwValueTemplate    *string `json:"rgbw_value_template,omitempty"`    // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the RGBW value."
	RgbwwCommandTemplate *string `json:"rgbww_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/) to compose message which will be sent to `rgbww_command_topic`. Available variables: `red`, `green`, `blue`, `cold_white` and `warm_white`."
	RgbwwCommandTopic    *string `json:"rgbww_command_topic,omitempty"`    // "The MQTT topic to publish commands to change the light's RGBWW state."

	RgbwwStateTopic *string `json:"rgbww_state_topic,omitempty"` // "The MQTT topic subscribed to receive RGBWW state updates. The expected payload is the RGBWW values separated by commas, for example, `255,0,127,64,32`."

	RgbwwValueTemplate *string `json:"rgbww_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the RGBWW value."
	Schema             *string `json:"schema,omitempty"`               // "The schema to use. Must be `default` or omitted to select the default schema."
	StateTopic         *string `json:"state_topic,omitempty"`          // "The MQTT topic subscribed to receive state updates."

	StateValueTemplate *string `json:"state_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the state value. The template should match the payload `on` and `off` values, so if your light uses `power on` to turn on, your `state_value_template` string should return `power on` when the switch is on. For example if the message is just `on`, your `state_value_template` should be `power {{ value }}`."
	UniqueId           *string `json:"unique_id,omitempty"`            // "An ID that uniquely identifies this light. If two lights have the same unique ID, Home Assistant will raise an exception."
	WhiteCommandTopic  *string `json:"white_command_topic,omitempty"`  // "The MQTT topic to publish commands to change the light to white mode with a given brightness."

	WhiteScale        *int    `json:"white_scale,omitempty"`         // "Defines the maximum white level (i.e., 100%) of the MQTT device."
	XyCommandTemplate *string `json:"xy_command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/) to compose message which will be sent to `xy_command_topic`. Available variables: `x` and `y`."
	XyCommandTopic    *string `json:"xy_command_topic,omitempty"`    // "The MQTT topic to publish commands to change the light's XY state."

	XyStateTopic *string `json:"xy_state_topic,omitempty"` // "The MQTT topic subscribed to receive XY state updates. The expected payload is the X and Y color values separated by commas, for example, `0.675,0.322`."

	XyValueTemplate *string     `json:"xy_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the XY value."
	MQTT            *MQTTFields `json:"-"`                           // MQTT configuration parameters

	States *LightState `json:"-"` // External state update location
	// contains filtered or unexported fields
}

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewLight added in v0.2.0

func NewLight(o *LightOptions) (*Light, error)

func (*Light) AddMessageHandler

func (d *Light) AddMessageHandler()

func (*Light) AnnounceAvailable

func (d *Light) AnnounceAvailable()

func (*Light) Brightness added in v0.2.1

func (d *Light) Brightness(s string)

func (*Light) ColorMode added in v0.2.1

func (d *Light) ColorMode(s string)

func (*Light) ColorTemp added in v0.2.1

func (d *Light) ColorTemp(s string)

func (*Light) DeleteTopic

func (d *Light) DeleteTopic()

func (*Light) Effect added in v0.2.1

func (d *Light) Effect(s string)

func (*Light) GetDomainEntity added in v0.2.3

func (d *Light) GetDomainEntity() string

func (*Light) GetMQTTFields

func (d *Light) GetMQTTFields() (fields MQTTFields)

func (*Light) GetName

func (d *Light) GetName() string

func (*Light) GetRawId

func (d *Light) GetRawId() string

func (*Light) GetUniqueId

func (d *Light) GetUniqueId() string

func (*Light) Hs added in v0.2.1

func (d *Light) Hs(s string)

func (*Light) Initialize

func (d *Light) Initialize()

func (*Light) JsonAttributes added in v0.2.1

func (d *Light) JsonAttributes(s string)

func (*Light) PopulateDevice

func (d *Light) PopulateDevice(Manufacturer string, SoftwareName string, InstanceName string, SWVersion string, Identifier string)

func (*Light) Rgb added in v0.2.1

func (d *Light) Rgb(s string)

func (*Light) Rgbw added in v0.2.1

func (d *Light) Rgbw(s string)

func (*Light) Rgbww added in v0.2.1

func (d *Light) Rgbww(s string)

func (*Light) SetMQTTFields

func (d *Light) SetMQTTFields(fields MQTTFields)

func (*Light) State added in v0.2.1

func (d *Light) State(s string)

func (*Light) Subscribe

func (d *Light) Subscribe()

func (*Light) UnSubscribe

func (d *Light) UnSubscribe()

func (*Light) UpdateState

func (d *Light) UpdateState()

func (*Light) Xy added in v0.2.1

func (d *Light) Xy(s string)

type LightOptions added in v0.2.0

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

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewLightOptions added in v0.2.0

func NewLightOptions() *LightOptions

func (*LightOptions) AvailabilityFunc added in v0.2.0

func (o *LightOptions) AvailabilityFunc(f func() string) *LightOptions

func (*LightOptions) AvailabilityMode added in v0.2.0

func (o *LightOptions) AvailabilityMode(mode string) *LightOptions

func (*LightOptions) AvailabilityTemplate added in v0.2.0

func (o *LightOptions) AvailabilityTemplate(template string) *LightOptions

func (*LightOptions) BrightnessCommandFunc added in v0.2.0

func (o *LightOptions) BrightnessCommandFunc(f func(mqtt.Message, mqtt.Client)) *LightOptions

func (*LightOptions) BrightnessCommandTemplate added in v0.2.0

func (o *LightOptions) BrightnessCommandTemplate(template string) *LightOptions

func (*LightOptions) BrightnessScale added in v0.2.0

func (o *LightOptions) BrightnessScale(scale int) *LightOptions

func (*LightOptions) BrightnessStateFunc added in v0.2.0

func (o *LightOptions) BrightnessStateFunc(f func() string) *LightOptions

func (*LightOptions) BrightnessValueTemplate added in v0.2.0

func (o *LightOptions) BrightnessValueTemplate(template string) *LightOptions

func (*LightOptions) ColorModeStateFunc added in v0.2.0

func (o *LightOptions) ColorModeStateFunc(f func() string) *LightOptions

func (*LightOptions) ColorModeValueTemplate added in v0.2.0

func (o *LightOptions) ColorModeValueTemplate(template string) *LightOptions

func (*LightOptions) ColorTempCommandFunc added in v0.2.0

func (o *LightOptions) ColorTempCommandFunc(f func(mqtt.Message, mqtt.Client)) *LightOptions

func (*LightOptions) ColorTempCommandTemplate added in v0.2.0

func (o *LightOptions) ColorTempCommandTemplate(template string) *LightOptions

func (*LightOptions) ColorTempStateFunc added in v0.2.0

func (o *LightOptions) ColorTempStateFunc(f func() string) *LightOptions

func (*LightOptions) ColorTempValueTemplate added in v0.2.0

func (o *LightOptions) ColorTempValueTemplate(template string) *LightOptions

func (*LightOptions) CommandFunc added in v0.2.0

func (o *LightOptions) CommandFunc(f func(mqtt.Message, mqtt.Client)) *LightOptions

func (*LightOptions) EffectCommandFunc added in v0.2.0

func (o *LightOptions) EffectCommandFunc(f func(mqtt.Message, mqtt.Client)) *LightOptions

func (*LightOptions) EffectCommandTemplate added in v0.2.0

func (o *LightOptions) EffectCommandTemplate(template string) *LightOptions

func (*LightOptions) EffectList added in v0.2.0

func (o *LightOptions) EffectList(list []string) *LightOptions

func (*LightOptions) EffectStateFunc added in v0.2.0

func (o *LightOptions) EffectStateFunc(f func() string) *LightOptions

func (*LightOptions) EffectValueTemplate added in v0.2.0

func (o *LightOptions) EffectValueTemplate(template string) *LightOptions

func (*LightOptions) EnableBrightness added in v0.2.1

func (o *LightOptions) EnableBrightness() *LightOptions

func (*LightOptions) EnableColorTemp added in v0.2.1

func (o *LightOptions) EnableColorTemp() *LightOptions

func (*LightOptions) EnableEffect added in v0.2.1

func (o *LightOptions) EnableEffect() *LightOptions

func (*LightOptions) EnableHs added in v0.2.1

func (o *LightOptions) EnableHs() *LightOptions

func (*LightOptions) EnableRgb added in v0.2.1

func (o *LightOptions) EnableRgb() *LightOptions

func (*LightOptions) EnableRgbw added in v0.2.1

func (o *LightOptions) EnableRgbw() *LightOptions

func (*LightOptions) EnableRgbww added in v0.2.1

func (o *LightOptions) EnableRgbww() *LightOptions

func (*LightOptions) EnableXy added in v0.2.1

func (o *LightOptions) EnableXy() *LightOptions

func (*LightOptions) EnabledByDefault added in v0.2.0

func (o *LightOptions) EnabledByDefault(d bool) *LightOptions

func (*LightOptions) Encoding added in v0.2.0

func (o *LightOptions) Encoding(encoding string) *LightOptions

func (*LightOptions) EntityCategory added in v0.2.0

func (o *LightOptions) EntityCategory(category string) *LightOptions

func (*LightOptions) HsCommandFunc added in v0.2.0

func (o *LightOptions) HsCommandFunc(f func(mqtt.Message, mqtt.Client)) *LightOptions

func (*LightOptions) HsCommandTemplate added in v0.2.0

func (o *LightOptions) HsCommandTemplate(template string) *LightOptions

func (*LightOptions) HsStateFunc added in v0.2.0

func (o *LightOptions) HsStateFunc(f func() string) *LightOptions

func (*LightOptions) HsValueTemplate added in v0.2.0

func (o *LightOptions) HsValueTemplate(template string) *LightOptions

func (*LightOptions) Icon added in v0.2.0

func (o *LightOptions) Icon(icon string) *LightOptions

func (*LightOptions) JsonAttributesFunc added in v0.2.0

func (o *LightOptions) JsonAttributesFunc(f func() string) *LightOptions

func (*LightOptions) JsonAttributesTemplate added in v0.2.0

func (o *LightOptions) JsonAttributesTemplate(template string) *LightOptions

func (*LightOptions) MaxMireds added in v0.2.0

func (o *LightOptions) MaxMireds(mireds int) *LightOptions

func (*LightOptions) MinMireds added in v0.2.0

func (o *LightOptions) MinMireds(mireds int) *LightOptions

func (*LightOptions) Name added in v0.2.0

func (o *LightOptions) Name(name string) *LightOptions

func (*LightOptions) ObjectId added in v0.2.0

func (o *LightOptions) ObjectId(id string) *LightOptions

func (*LightOptions) OnCommandType added in v0.2.0

func (o *LightOptions) OnCommandType(t string) *LightOptions

func (*LightOptions) Optimistic added in v0.2.0

func (o *LightOptions) Optimistic(optimistic bool) *LightOptions

func (*LightOptions) PayloadAvailable added in v0.2.0

func (o *LightOptions) PayloadAvailable(available string) *LightOptions

func (*LightOptions) PayloadNotAvailable added in v0.2.0

func (o *LightOptions) PayloadNotAvailable(available string) *LightOptions

func (*LightOptions) PayloadOff added in v0.2.0

func (o *LightOptions) PayloadOff(off string) *LightOptions

func (*LightOptions) PayloadOn added in v0.2.0

func (o *LightOptions) PayloadOn(on string) *LightOptions

func (*LightOptions) Qos added in v0.2.0

func (o *LightOptions) Qos(qos int) *LightOptions

func (*LightOptions) Retain added in v0.2.0

func (o *LightOptions) Retain(retain bool) *LightOptions

func (*LightOptions) RgbCommandFunc added in v0.2.0

func (o *LightOptions) RgbCommandFunc(f func(mqtt.Message, mqtt.Client)) *LightOptions

func (*LightOptions) RgbCommandTemplate added in v0.2.0

func (o *LightOptions) RgbCommandTemplate(template string) *LightOptions

func (*LightOptions) RgbStateFunc added in v0.2.0

func (o *LightOptions) RgbStateFunc(f func() string) *LightOptions

func (*LightOptions) RgbValueTemplate added in v0.2.0

func (o *LightOptions) RgbValueTemplate(template string) *LightOptions

func (*LightOptions) RgbwCommandFunc added in v0.2.0

func (o *LightOptions) RgbwCommandFunc(f func(mqtt.Message, mqtt.Client)) *LightOptions

func (*LightOptions) RgbwCommandTemplate added in v0.2.0

func (o *LightOptions) RgbwCommandTemplate(template string) *LightOptions

func (*LightOptions) RgbwStateFunc added in v0.2.0

func (o *LightOptions) RgbwStateFunc(f func() string) *LightOptions

func (*LightOptions) RgbwValueTemplate added in v0.2.0

func (o *LightOptions) RgbwValueTemplate(template string) *LightOptions

func (*LightOptions) RgbwwCommandFunc added in v0.2.0

func (o *LightOptions) RgbwwCommandFunc(f func(mqtt.Message, mqtt.Client)) *LightOptions

func (*LightOptions) RgbwwCommandTemplate added in v0.2.0

func (o *LightOptions) RgbwwCommandTemplate(template string) *LightOptions

func (*LightOptions) RgbwwStateFunc added in v0.2.0

func (o *LightOptions) RgbwwStateFunc(f func() string) *LightOptions

func (*LightOptions) RgbwwValueTemplate added in v0.2.0

func (o *LightOptions) RgbwwValueTemplate(template string) *LightOptions

func (*LightOptions) Schema added in v0.2.0

func (o *LightOptions) Schema(schema string) *LightOptions

func (*LightOptions) StateFunc added in v0.2.0

func (o *LightOptions) StateFunc(f func() string) *LightOptions

func (*LightOptions) StateValueTemplate added in v0.2.0

func (o *LightOptions) StateValueTemplate(template string) *LightOptions

func (*LightOptions) States added in v0.2.0

func (o *LightOptions) States() *LightState

func (*LightOptions) UniqueId added in v0.2.0

func (o *LightOptions) UniqueId(id string) *LightOptions

func (*LightOptions) WhiteCommandFunc added in v0.2.0

func (o *LightOptions) WhiteCommandFunc(f func(mqtt.Message, mqtt.Client)) *LightOptions

func (*LightOptions) WhiteScale added in v0.2.0

func (o *LightOptions) WhiteScale(scale int) *LightOptions

func (*LightOptions) XyCommandFunc added in v0.2.0

func (o *LightOptions) XyCommandFunc(f func(mqtt.Message, mqtt.Client)) *LightOptions

func (*LightOptions) XyCommandTemplate added in v0.2.0

func (o *LightOptions) XyCommandTemplate(template string) *LightOptions

func (*LightOptions) XyStateFunc added in v0.2.0

func (o *LightOptions) XyStateFunc(f func() string) *LightOptions

func (*LightOptions) XyValueTemplate added in v0.2.0

func (o *LightOptions) XyValueTemplate(template string) *LightOptions

type LightRef added in v0.2.0

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

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

type LightRefOptions added in v0.2.0

type LightRefOptions struct {
	Brightness      bool
	BrightnessScale int
}

func NewLightRefOptions added in v0.2.0

func NewLightRefOptions() *LightRefOptions

func (*LightRefOptions) EnableBrightness added in v0.2.0

func (o *LightRefOptions) EnableBrightness(scale int) *LightRefOptions

type LightState added in v0.2.0

type LightState struct {
	Brightness     string
	ColorMode      string
	ColorTemp      string
	Effect         string
	Hs             string
	JsonAttributes string
	Rgb            string
	Rgbw           string
	Rgbww          string
	State          string
	Xy             string
}

type Lock

type Lock struct {
	AvailabilityMode     *string `json:"availability_mode,omitempty"`     // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability."
	AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`."
	AvailabilityTopic    *string `json:"availability_topic,omitempty"`    // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`."

	CodeFormat      *string `json:"code_format,omitempty"`      // "A regular expression to validate a supplied code when it is set during the service call to `open`, `lock` or `unlock` the MQTT lock."
	CommandTemplate *string `json:"command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `command_topic`. The lock command template accepts the parameters `value` and `code`. The `value` parameter will contain the configured value for either `payload_open`, `payload_lock` or `payload_unlock`. The `code` parameter is set during the service call to `open`, `lock` or `unlock` the MQTT lock and will be set `None` if no code was passed."
	CommandTopic    *string `json:"command_topic,omitempty"`    // "The MQTT topic to publish commands to change the lock state."

	Device                 Device  `json:"device,omitempty"`                   // Device configuration parameters
	EnabledByDefault       *bool   `json:"enabled_by_default,omitempty"`       // "Flag which defines if the entity should be enabled when first added."
	Encoding               *string `json:"encoding,omitempty"`                 // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload."
	EntityCategory         *string `json:"entity_category,omitempty"`          // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity."
	Icon                   *string `json:"icon,omitempty"`                     // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity."
	JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation."
	JsonAttributesTopic    *string `json:"json_attributes_topic,omitempty"`    // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation."

	Name                *string `json:"name,omitempty"`                  // "The name of the lock."
	ObjectId            *string `json:"object_id,omitempty"`             // "Used instead of `name` for automatic generation of `entity_id`"
	Optimistic          *bool   `json:"optimistic,omitempty"`            // "Flag that defines if lock works in optimistic mode."
	PayloadAvailable    *string `json:"payload_available,omitempty"`     // "The payload that represents the available state."
	PayloadLock         *string `json:"payload_lock,omitempty"`          // "The payload sent to the lock to lock it."
	PayloadNotAvailable *string `json:"payload_not_available,omitempty"` // "The payload that represents the unavailable state."
	PayloadOpen         *string `json:"payload_open,omitempty"`          // "The payload sent to the lock to open it."
	PayloadUnlock       *string `json:"payload_unlock,omitempty"`        // "The payload sent to the lock to unlock it."
	Qos                 *int    `json:"qos,omitempty"`                   // "The maximum QoS level of the state topic. It will also be used for messages published to command topic."
	Retain              *bool   `json:"retain,omitempty"`                // "If the published message should have the retain flag on or not."
	StateJammed         *string `json:"state_jammed,omitempty"`          // "The payload sent to `state_topic` by the lock when it's jammed."
	StateLocked         *string `json:"state_locked,omitempty"`          // "The payload sent to `state_topic` by the lock when it's locked."
	StateLocking        *string `json:"state_locking,omitempty"`         // "The payload sent to `state_topic` by the lock when it's locking."
	StateTopic          *string `json:"state_topic,omitempty"`           // "The MQTT topic subscribed to receive state updates. It accepts states configured with `state_jammed`, `state_locked`, `state_unlocked`, `state_locking` or `state_unlocking`."

	StateUnlocked  *string     `json:"state_unlocked,omitempty"`  // "The payload sent to `state_topic` by the lock when it's unlocked."
	StateUnlocking *string     `json:"state_unlocking,omitempty"` // "The payload sent to `state_topic` by the lock when it's unlocking."
	UniqueId       *string     `json:"unique_id,omitempty"`       // "An ID that uniquely identifies this lock. If two locks have the same unique ID, Home Assistant will raise an exception."
	ValueTemplate  *string     `json:"value_template,omitempty"`  // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract a state value from the payload."
	MQTT           *MQTTFields `json:"-"`                         // MQTT configuration parameters

	States *LockState `json:"-"` // External state update location
	// contains filtered or unexported fields
}

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewLock added in v0.2.0

func NewLock(o *LockOptions) (*Lock, error)

func (*Lock) AddMessageHandler

func (d *Lock) AddMessageHandler()

func (*Lock) AnnounceAvailable

func (d *Lock) AnnounceAvailable()

func (*Lock) DeleteTopic

func (d *Lock) DeleteTopic()

func (*Lock) GetDomainEntity added in v0.2.3

func (d *Lock) GetDomainEntity() string

func (*Lock) GetMQTTFields

func (d *Lock) GetMQTTFields() (fields MQTTFields)

func (*Lock) GetName

func (d *Lock) GetName() string

func (*Lock) GetRawId

func (d *Lock) GetRawId() string

func (*Lock) GetUniqueId

func (d *Lock) GetUniqueId() string

func (*Lock) Initialize

func (d *Lock) Initialize()

func (*Lock) JsonAttributes added in v0.2.1

func (d *Lock) JsonAttributes(s string)

func (*Lock) PopulateDevice

func (d *Lock) PopulateDevice(Manufacturer string, SoftwareName string, InstanceName string, SWVersion string, Identifier string)

func (*Lock) SetMQTTFields

func (d *Lock) SetMQTTFields(fields MQTTFields)

func (*Lock) State added in v0.2.1

func (d *Lock) State(s string)

func (*Lock) Subscribe

func (d *Lock) Subscribe()

func (*Lock) UnSubscribe

func (d *Lock) UnSubscribe()

func (*Lock) UpdateState

func (d *Lock) UpdateState()

type LockOptions added in v0.2.0

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

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewLockOptions added in v0.2.0

func NewLockOptions() *LockOptions

func (*LockOptions) AvailabilityFunc added in v0.2.0

func (o *LockOptions) AvailabilityFunc(f func() string) *LockOptions

func (*LockOptions) AvailabilityMode added in v0.2.0

func (o *LockOptions) AvailabilityMode(mode string) *LockOptions

func (*LockOptions) AvailabilityTemplate added in v0.2.0

func (o *LockOptions) AvailabilityTemplate(template string) *LockOptions

func (*LockOptions) CodeFormat added in v0.2.0

func (o *LockOptions) CodeFormat(format string) *LockOptions

func (*LockOptions) CommandFunc added in v0.2.0

func (o *LockOptions) CommandFunc(f func(mqtt.Message, mqtt.Client)) *LockOptions

func (*LockOptions) CommandTemplate added in v0.2.0

func (o *LockOptions) CommandTemplate(template string) *LockOptions

func (*LockOptions) EnabledByDefault added in v0.2.0

func (o *LockOptions) EnabledByDefault(d bool) *LockOptions

func (*LockOptions) Encoding added in v0.2.0

func (o *LockOptions) Encoding(encoding string) *LockOptions

func (*LockOptions) EntityCategory added in v0.2.0

func (o *LockOptions) EntityCategory(category string) *LockOptions

func (*LockOptions) Icon added in v0.2.0

func (o *LockOptions) Icon(icon string) *LockOptions

func (*LockOptions) JsonAttributesFunc added in v0.2.0

func (o *LockOptions) JsonAttributesFunc(f func() string) *LockOptions

func (*LockOptions) JsonAttributesTemplate added in v0.2.0

func (o *LockOptions) JsonAttributesTemplate(template string) *LockOptions

func (*LockOptions) Name added in v0.2.0

func (o *LockOptions) Name(name string) *LockOptions

func (*LockOptions) ObjectId added in v0.2.0

func (o *LockOptions) ObjectId(id string) *LockOptions

func (*LockOptions) Optimistic added in v0.2.0

func (o *LockOptions) Optimistic(optimistic bool) *LockOptions

func (*LockOptions) PayloadAvailable added in v0.2.0

func (o *LockOptions) PayloadAvailable(available string) *LockOptions

func (*LockOptions) PayloadLock added in v0.2.0

func (o *LockOptions) PayloadLock(lock string) *LockOptions

func (*LockOptions) PayloadNotAvailable added in v0.2.0

func (o *LockOptions) PayloadNotAvailable(available string) *LockOptions

func (*LockOptions) PayloadOpen added in v0.2.0

func (o *LockOptions) PayloadOpen(open string) *LockOptions

func (*LockOptions) PayloadUnlock added in v0.2.0

func (o *LockOptions) PayloadUnlock(unlock string) *LockOptions

func (*LockOptions) Qos added in v0.2.0

func (o *LockOptions) Qos(qos int) *LockOptions

func (*LockOptions) Retain added in v0.2.0

func (o *LockOptions) Retain(retain bool) *LockOptions

func (*LockOptions) StateFunc added in v0.2.0

func (o *LockOptions) StateFunc(f func() string) *LockOptions

func (*LockOptions) StateJammed added in v0.2.0

func (o *LockOptions) StateJammed(jammed string) *LockOptions

func (*LockOptions) StateLocked added in v0.2.0

func (o *LockOptions) StateLocked(locked string) *LockOptions

func (*LockOptions) StateLocking added in v0.2.0

func (o *LockOptions) StateLocking(locking string) *LockOptions

func (*LockOptions) StateUnlocked added in v0.2.0

func (o *LockOptions) StateUnlocked(unlocked string) *LockOptions

func (*LockOptions) StateUnlocking added in v0.2.0

func (o *LockOptions) StateUnlocking(unlocking string) *LockOptions

func (*LockOptions) States added in v0.2.0

func (o *LockOptions) States() *LockState

func (*LockOptions) UniqueId added in v0.2.0

func (o *LockOptions) UniqueId(id string) *LockOptions

func (*LockOptions) ValueTemplate added in v0.2.0

func (o *LockOptions) ValueTemplate(template string) *LockOptions

type LockState added in v0.2.0

type LockState struct {
	JsonAttributes string
	State          string
}

type MQTTFields

type MQTTFields struct {
	Client         *mqtt.Client
	ForceUpdate    *bool
	MessageHandler mqtt.MessageHandler
	UpdateInterval *float64
}

type Number

type Number struct {
	AvailabilityMode  *string `json:"availability_mode,omitempty"`  // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability."
	AvailabilityTopic *string `json:"availability_topic,omitempty"` // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`."

	CommandTemplate *string `json:"command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `command_topic`."
	CommandTopic    *string `json:"command_topic,omitempty"`    // "The MQTT topic to publish commands to change the number."

	Device                 Device  `json:"device,omitempty"`                   // Device configuration parameters
	DeviceClass            *string `json:"device_class,omitempty"`             // "The [type/class](/integrations/number/#device-class) of the number."
	EnabledByDefault       *bool   `json:"enabled_by_default,omitempty"`       // "Flag which defines if the entity should be enabled when first added."
	Encoding               *string `json:"encoding,omitempty"`                 // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload."
	EntityCategory         *string `json:"entity_category,omitempty"`          // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity."
	Icon                   *string `json:"icon,omitempty"`                     // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity."
	JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`."
	JsonAttributesTopic    *string `json:"json_attributes_topic,omitempty"`    // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as number attributes. Implies `force_update` of the current number state when a message is received on this topic."

	Max          *float64 `json:"max,omitempty"`           // "Maximum value."
	Min          *float64 `json:"min,omitempty"`           // "Minimum value."
	Mode         *string  `json:"mode,omitempty"`          // "Control how the number should be displayed in the UI. Can be set to `box` or `slider` to force a display mode."
	Name         *string  `json:"name,omitempty"`          // "The name of the Number."
	ObjectId     *string  `json:"object_id,omitempty"`     // "Used instead of `name` for automatic generation of `entity_id`"
	Optimistic   *bool    `json:"optimistic,omitempty"`    // "Flag that defines if number works in optimistic mode."
	PayloadReset *string  `json:"payload_reset,omitempty"` // "A special payload that resets the state to `None` when received on the `state_topic`."
	Qos          *int     `json:"qos,omitempty"`           // "The maximum QoS level of the state topic. Default is 0 and will also be used to publishing messages."
	Retain       *bool    `json:"retain,omitempty"`        // "If the published message should have the retain flag on or not."
	StateTopic   *string  `json:"state_topic,omitempty"`   // "The MQTT topic subscribed to receive number values."

	Step              *float64    `json:"step,omitempty"`                // "Step value. Smallest value `0.001`."
	UniqueId          *string     `json:"unique_id,omitempty"`           // "An ID that uniquely identifies this Number. If two Numbers have the same unique ID Home Assistant will raise an exception."
	UnitOfMeasurement *string     `json:"unit_of_measurement,omitempty"` // "Defines the unit of measurement of the sensor, if any."
	ValueTemplate     *string     `json:"value_template,omitempty"`      // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the value."
	MQTT              *MQTTFields `json:"-"`                             // MQTT configuration parameters

	States *NumberState `json:"-"` // External state update location
	// contains filtered or unexported fields
}

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewNumber added in v0.2.0

func NewNumber(o *NumberOptions) (*Number, error)

func (*Number) AddMessageHandler

func (d *Number) AddMessageHandler()

func (*Number) AnnounceAvailable

func (d *Number) AnnounceAvailable()

func (*Number) DeleteTopic

func (d *Number) DeleteTopic()

func (*Number) GetDomainEntity added in v0.2.3

func (d *Number) GetDomainEntity() string

func (*Number) GetMQTTFields

func (d *Number) GetMQTTFields() (fields MQTTFields)

func (*Number) GetName

func (d *Number) GetName() string

func (*Number) GetRawId

func (d *Number) GetRawId() string

func (*Number) GetUniqueId

func (d *Number) GetUniqueId() string

func (*Number) Initialize

func (d *Number) Initialize()

func (*Number) JsonAttributes added in v0.2.1

func (d *Number) JsonAttributes(s string)

func (*Number) PopulateDevice

func (d *Number) PopulateDevice(Manufacturer string, SoftwareName string, InstanceName string, SWVersion string, Identifier string)

func (*Number) SetMQTTFields

func (d *Number) SetMQTTFields(fields MQTTFields)

func (*Number) State added in v0.2.1

func (d *Number) State(s string)

func (*Number) Subscribe

func (d *Number) Subscribe()

func (*Number) UnSubscribe

func (d *Number) UnSubscribe()

func (*Number) UpdateState

func (d *Number) UpdateState()

type NumberOptions added in v0.2.0

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

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewNumberOptions added in v0.2.0

func NewNumberOptions() *NumberOptions

func (*NumberOptions) AvailabilityFunc added in v0.2.0

func (o *NumberOptions) AvailabilityFunc(f func() string) *NumberOptions

func (*NumberOptions) AvailabilityMode added in v0.2.0

func (o *NumberOptions) AvailabilityMode(mode string) *NumberOptions

func (*NumberOptions) CommandFunc added in v0.2.0

func (o *NumberOptions) CommandFunc(f func(mqtt.Message, mqtt.Client)) *NumberOptions

func (*NumberOptions) CommandTemplate added in v0.2.0

func (o *NumberOptions) CommandTemplate(template string) *NumberOptions

func (*NumberOptions) DeviceClass added in v0.2.0

func (o *NumberOptions) DeviceClass(class string) *NumberOptions

func (*NumberOptions) EnabledByDefault added in v0.2.0

func (o *NumberOptions) EnabledByDefault(d bool) *NumberOptions

func (*NumberOptions) Encoding added in v0.2.0

func (o *NumberOptions) Encoding(encoding string) *NumberOptions

func (*NumberOptions) EntityCategory added in v0.2.0

func (o *NumberOptions) EntityCategory(category string) *NumberOptions

func (*NumberOptions) Icon added in v0.2.0

func (o *NumberOptions) Icon(icon string) *NumberOptions

func (*NumberOptions) JsonAttributesFunc added in v0.2.0

func (o *NumberOptions) JsonAttributesFunc(f func() string) *NumberOptions

func (*NumberOptions) JsonAttributesTemplate added in v0.2.0

func (o *NumberOptions) JsonAttributesTemplate(template string) *NumberOptions

func (*NumberOptions) Max added in v0.2.0

func (o *NumberOptions) Max(max float64) *NumberOptions

func (*NumberOptions) Min added in v0.2.0

func (o *NumberOptions) Min(min float64) *NumberOptions

func (*NumberOptions) Mode added in v0.2.0

func (o *NumberOptions) Mode(mode string) *NumberOptions

func (*NumberOptions) Name added in v0.2.0

func (o *NumberOptions) Name(name string) *NumberOptions

func (*NumberOptions) ObjectId added in v0.2.0

func (o *NumberOptions) ObjectId(id string) *NumberOptions

func (*NumberOptions) Optimistic added in v0.2.0

func (o *NumberOptions) Optimistic(optimistic bool) *NumberOptions

func (*NumberOptions) PayloadReset added in v0.2.0

func (o *NumberOptions) PayloadReset(reset string) *NumberOptions

func (*NumberOptions) Qos added in v0.2.0

func (o *NumberOptions) Qos(qos int) *NumberOptions

func (*NumberOptions) Retain added in v0.2.0

func (o *NumberOptions) Retain(retain bool) *NumberOptions

func (*NumberOptions) StateFunc added in v0.2.0

func (o *NumberOptions) StateFunc(f func() string) *NumberOptions

func (*NumberOptions) States added in v0.2.0

func (o *NumberOptions) States() *NumberState

func (*NumberOptions) Step added in v0.2.0

func (o *NumberOptions) Step(step float64) *NumberOptions

func (*NumberOptions) UniqueId added in v0.2.0

func (o *NumberOptions) UniqueId(id string) *NumberOptions

func (*NumberOptions) UnitOfMeasurement added in v0.2.0

func (o *NumberOptions) UnitOfMeasurement(measurement string) *NumberOptions

func (*NumberOptions) ValueTemplate added in v0.2.0

func (o *NumberOptions) ValueTemplate(template string) *NumberOptions

type NumberState added in v0.2.0

type NumberState struct {
	JsonAttributes string
	State          string
}

type Scene

type Scene struct {
	AvailabilityMode     *string `json:"availability_mode,omitempty"`     // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability."
	AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`."
	AvailabilityTopic    *string `json:"availability_topic,omitempty"`    // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`."

	CommandTopic *string `json:"command_topic,omitempty"` // "The MQTT topic to publish `payload_on` to activate the scene."

	EnabledByDefault    *bool       `json:"enabled_by_default,omitempty"`    // "Flag which defines if the entity should be enabled when first added."
	EntityCategory      *string     `json:"entity_category,omitempty"`       // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity."
	Icon                *string     `json:"icon,omitempty"`                  // "Icon for the scene."
	Name                *string     `json:"name,omitempty"`                  // "The name to use when displaying this scene."
	ObjectId            *string     `json:"object_id,omitempty"`             // "Used instead of `name` for automatic generation of `entity_id`"
	PayloadAvailable    *string     `json:"payload_available,omitempty"`     // "The payload that represents the available state."
	PayloadNotAvailable *string     `json:"payload_not_available,omitempty"` // "The payload that represents the unavailable state."
	PayloadOn           *string     `json:"payload_on,omitempty"`            // "The payload that will be sent to `command_topic` when activating the MQTT scene."
	Qos                 *int        `json:"qos,omitempty"`                   // "The maximum QoS level of the state topic. Default is 0 and will also be used to publishing messages."
	Retain              *bool       `json:"retain,omitempty"`                // "If the published message should have the retain flag on or not."
	UniqueId            *string     `json:"unique_id,omitempty"`             // "An ID that uniquely identifies this scene entity. If two scenes have the same unique ID, Home Assistant will raise an exception."
	MQTT                *MQTTFields `json:"-"`                               // MQTT configuration parameters

	States *SceneState `json:"-"` // External state update location
	// contains filtered or unexported fields
}

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewScene added in v0.2.0

func NewScene(o *SceneOptions) (*Scene, error)

func (*Scene) AddMessageHandler

func (d *Scene) AddMessageHandler()

func (*Scene) AnnounceAvailable

func (d *Scene) AnnounceAvailable()

func (*Scene) DeleteTopic

func (d *Scene) DeleteTopic()

func (*Scene) GetDomainEntity added in v0.2.3

func (d *Scene) GetDomainEntity() string

func (*Scene) GetMQTTFields

func (d *Scene) GetMQTTFields() (fields MQTTFields)

func (*Scene) GetName

func (d *Scene) GetName() string

func (*Scene) GetRawId

func (d *Scene) GetRawId() string

func (*Scene) GetUniqueId

func (d *Scene) GetUniqueId() string

func (*Scene) Initialize

func (d *Scene) Initialize()

func (*Scene) PopulateDevice

func (d *Scene) PopulateDevice(_ string, _ string, _ string, _ string, _ string)

func (*Scene) SetMQTTFields

func (d *Scene) SetMQTTFields(fields MQTTFields)

func (*Scene) Subscribe

func (d *Scene) Subscribe()

func (*Scene) UnSubscribe

func (d *Scene) UnSubscribe()

func (*Scene) UpdateState

func (d *Scene) UpdateState()

type SceneOptions added in v0.2.0

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

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewSceneOptions added in v0.2.0

func NewSceneOptions() *SceneOptions

func (*SceneOptions) AvailabilityFunc added in v0.2.0

func (o *SceneOptions) AvailabilityFunc(f func() string) *SceneOptions

func (*SceneOptions) AvailabilityMode added in v0.2.0

func (o *SceneOptions) AvailabilityMode(mode string) *SceneOptions

func (*SceneOptions) AvailabilityTemplate added in v0.2.0

func (o *SceneOptions) AvailabilityTemplate(template string) *SceneOptions

func (*SceneOptions) CommandFunc added in v0.2.0

func (o *SceneOptions) CommandFunc(f func(mqtt.Message, mqtt.Client)) *SceneOptions

func (*SceneOptions) EnabledByDefault added in v0.2.0

func (o *SceneOptions) EnabledByDefault(d bool) *SceneOptions

func (*SceneOptions) EntityCategory added in v0.2.0

func (o *SceneOptions) EntityCategory(category string) *SceneOptions

func (*SceneOptions) Icon added in v0.2.0

func (o *SceneOptions) Icon(icon string) *SceneOptions

func (*SceneOptions) Name added in v0.2.0

func (o *SceneOptions) Name(name string) *SceneOptions

func (*SceneOptions) ObjectId added in v0.2.0

func (o *SceneOptions) ObjectId(id string) *SceneOptions

func (*SceneOptions) PayloadAvailable added in v0.2.0

func (o *SceneOptions) PayloadAvailable(available string) *SceneOptions

func (*SceneOptions) PayloadNotAvailable added in v0.2.0

func (o *SceneOptions) PayloadNotAvailable(available string) *SceneOptions

func (*SceneOptions) PayloadOn added in v0.2.0

func (o *SceneOptions) PayloadOn(on string) *SceneOptions

func (*SceneOptions) Qos added in v0.2.0

func (o *SceneOptions) Qos(qos int) *SceneOptions

func (*SceneOptions) Retain added in v0.2.0

func (o *SceneOptions) Retain(retain bool) *SceneOptions

func (*SceneOptions) States added in v0.2.0

func (o *SceneOptions) States() *SceneState

func (*SceneOptions) UniqueId added in v0.2.0

func (o *SceneOptions) UniqueId(id string) *SceneOptions

type SceneState added in v0.2.0

type SceneState struct{}

type Select

type Select struct {
	AvailabilityMode     *string `json:"availability_mode,omitempty"`     // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability."
	AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`."
	AvailabilityTopic    *string `json:"availability_topic,omitempty"`    // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`."

	CommandTemplate *string `json:"command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `command_topic`."
	CommandTopic    *string `json:"command_topic,omitempty"`    // "The MQTT topic to publish commands to change the selected option."

	Device                 Device  `json:"device,omitempty"`                   // Device configuration parameters
	EnabledByDefault       *bool   `json:"enabled_by_default,omitempty"`       // "Flag which defines if the entity should be enabled when first added."
	Encoding               *string `json:"encoding,omitempty"`                 // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload."
	EntityCategory         *string `json:"entity_category,omitempty"`          // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity."
	Icon                   *string `json:"icon,omitempty"`                     // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity."
	JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`."
	JsonAttributesTopic    *string `json:"json_attributes_topic,omitempty"`    // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as entity attributes. Implies `force_update` of the current select state when a message is received on this topic."

	Name       *string     `json:"name,omitempty"`        // "The name of the Select."
	ObjectId   *string     `json:"object_id,omitempty"`   // "Used instead of `name` for automatic generation of `entity_id`"
	Optimistic *bool       `json:"optimistic,omitempty"`  // "Flag that defines if the select works in optimistic mode."
	Options    *([]string) `json:"options,omitempty"`     // "List of options that can be selected. An empty list or a list with a single item is allowed."
	Qos        *int        `json:"qos,omitempty"`         // "The maximum QoS level of the state topic. Default is 0 and will also be used to publishing messages."
	Retain     *bool       `json:"retain,omitempty"`      // "If the published message should have the retain flag on or not."
	StateTopic *string     `json:"state_topic,omitempty"` // "The MQTT topic subscribed to receive update of the selected option."

	UniqueId      *string     `json:"unique_id,omitempty"`      // "An ID that uniquely identifies this Select. If two Selects have the same unique ID Home Assistant will raise an exception."
	ValueTemplate *string     `json:"value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the value."
	MQTT          *MQTTFields `json:"-"`                        // MQTT configuration parameters

	States *SelectState `json:"-"` // External state update location
	// contains filtered or unexported fields
}

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewSelect added in v0.2.0

func NewSelect(o *SelectOptions) (*Select, error)

func (*Select) AddMessageHandler

func (d *Select) AddMessageHandler()

func (*Select) AnnounceAvailable

func (d *Select) AnnounceAvailable()

func (*Select) DeleteTopic

func (d *Select) DeleteTopic()

func (*Select) GetDomainEntity added in v0.2.3

func (d *Select) GetDomainEntity() string

func (*Select) GetMQTTFields

func (d *Select) GetMQTTFields() (fields MQTTFields)

func (*Select) GetName

func (d *Select) GetName() string

func (*Select) GetRawId

func (d *Select) GetRawId() string

func (*Select) GetUniqueId

func (d *Select) GetUniqueId() string

func (*Select) Initialize

func (d *Select) Initialize()

func (*Select) JsonAttributes added in v0.2.1

func (d *Select) JsonAttributes(s string)

func (*Select) PopulateDevice

func (d *Select) PopulateDevice(Manufacturer string, SoftwareName string, InstanceName string, SWVersion string, Identifier string)

func (*Select) SetMQTTFields

func (d *Select) SetMQTTFields(fields MQTTFields)

func (*Select) State added in v0.2.1

func (d *Select) State(s string)

func (*Select) Subscribe

func (d *Select) Subscribe()

func (*Select) UnSubscribe

func (d *Select) UnSubscribe()

func (*Select) UpdateState

func (d *Select) UpdateState()

type SelectOptions added in v0.2.0

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

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewSelectOptions added in v0.2.0

func NewSelectOptions() *SelectOptions

func (*SelectOptions) AvailabilityFunc added in v0.2.0

func (o *SelectOptions) AvailabilityFunc(f func() string) *SelectOptions

func (*SelectOptions) AvailabilityMode added in v0.2.0

func (o *SelectOptions) AvailabilityMode(mode string) *SelectOptions

func (*SelectOptions) AvailabilityTemplate added in v0.2.0

func (o *SelectOptions) AvailabilityTemplate(template string) *SelectOptions

func (*SelectOptions) CommandFunc added in v0.2.0

func (o *SelectOptions) CommandFunc(f func(mqtt.Message, mqtt.Client)) *SelectOptions

func (*SelectOptions) CommandTemplate added in v0.2.0

func (o *SelectOptions) CommandTemplate(template string) *SelectOptions

func (*SelectOptions) EnabledByDefault added in v0.2.0

func (o *SelectOptions) EnabledByDefault(d bool) *SelectOptions

func (*SelectOptions) Encoding added in v0.2.0

func (o *SelectOptions) Encoding(encoding string) *SelectOptions

func (*SelectOptions) EntityCategory added in v0.2.0

func (o *SelectOptions) EntityCategory(category string) *SelectOptions

func (*SelectOptions) Icon added in v0.2.0

func (o *SelectOptions) Icon(icon string) *SelectOptions

func (*SelectOptions) JsonAttributesFunc added in v0.2.0

func (o *SelectOptions) JsonAttributesFunc(f func() string) *SelectOptions

func (*SelectOptions) JsonAttributesTemplate added in v0.2.0

func (o *SelectOptions) JsonAttributesTemplate(template string) *SelectOptions

func (*SelectOptions) Name added in v0.2.0

func (o *SelectOptions) Name(name string) *SelectOptions

func (*SelectOptions) ObjectId added in v0.2.0

func (o *SelectOptions) ObjectId(id string) *SelectOptions

func (*SelectOptions) Optimistic added in v0.2.0

func (o *SelectOptions) Optimistic(optimistic bool) *SelectOptions

func (*SelectOptions) Options added in v0.2.0

func (o *SelectOptions) Options(options []string) *SelectOptions

func (*SelectOptions) Qos added in v0.2.0

func (o *SelectOptions) Qos(qos int) *SelectOptions

func (*SelectOptions) Retain added in v0.2.0

func (o *SelectOptions) Retain(retain bool) *SelectOptions

func (*SelectOptions) StateFunc added in v0.2.0

func (o *SelectOptions) StateFunc(f func() string) *SelectOptions

func (*SelectOptions) States added in v0.2.0

func (o *SelectOptions) States() *SelectState

func (*SelectOptions) UniqueId added in v0.2.0

func (o *SelectOptions) UniqueId(id string) *SelectOptions

func (*SelectOptions) ValueTemplate added in v0.2.0

func (o *SelectOptions) ValueTemplate(template string) *SelectOptions

type SelectState added in v0.2.0

type SelectState struct {
	JsonAttributes string
	State          string
}

type Sensor

type Sensor struct {
	AvailabilityMode     *string `json:"availability_mode,omitempty"`     // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability."
	AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`."
	AvailabilityTopic    *string `json:"availability_topic,omitempty"`    // "The MQTT topic subscribed to receive availability (online/offline) updates."

	Device                 Device  `json:"device,omitempty"`                   // Device configuration parameters
	DeviceClass            *string `json:"device_class,omitempty"`             // "The [type/class](/integrations/sensor/#device-class) of the sensor to set the icon in the frontend."
	EnabledByDefault       *bool   `json:"enabled_by_default,omitempty"`       // "Flag which defines if the entity should be enabled when first added."
	Encoding               *string `json:"encoding,omitempty"`                 // "The encoding of the payloads received. Set to `\"\"` to disable decoding of incoming payload."
	EntityCategory         *string `json:"entity_category,omitempty"`          // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity."
	ExpireAfter            *int    `json:"expire_after,omitempty"`             // "If set, it defines the number of seconds after the sensor's state expires, if it's not updated. After expiry, the sensor's state becomes `unavailable`. Default the sensors state never expires."
	ForceUpdate            *bool   `json:"force_update,omitempty"`             // "Sends update events even if the value hasn't changed. Useful if you want to have meaningful value graphs in history."
	Icon                   *string `json:"icon,omitempty"`                     // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity."
	JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`."
	JsonAttributesTopic    *string `json:"json_attributes_topic,omitempty"`    // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Implies `force_update` of the current sensor state when a message is received on this topic."

	LastResetValueTemplate *string `json:"last_reset_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the last_reset. Available variables: `entity_id`. The `entity_id` can be used to reference the entity's attributes."
	Name                   *string `json:"name,omitempty"`                      // "The name of the MQTT sensor."
	ObjectId               *string `json:"object_id,omitempty"`                 // "Used instead of `name` for automatic generation of `entity_id`"
	PayloadAvailable       *string `json:"payload_available,omitempty"`         // "The payload that represents the available state."
	PayloadNotAvailable    *string `json:"payload_not_available,omitempty"`     // "The payload that represents the unavailable state."
	Qos                    *int    `json:"qos,omitempty"`                       // "The maximum QoS level of the state topic."
	StateClass             *string `json:"state_class,omitempty"`               // "The [state_class](https://developers.home-assistant.io/docs/core/entity/sensor#available-state-classes) of the sensor."
	StateTopic             *string `json:"state_topic,omitempty"`               // "The MQTT topic subscribed to receive sensor values. If `device_class`, `state_class`, `unit_of_measurement` or `suggested_display_precision` is set, and a numeric value is expected, an empty value `”` will be ignored and will not update the state, a `'None'` value will set the sensor to an `unknown` state."

	SuggestedDisplayPrecision *int        `json:"suggested_display_precision,omitempty"` // "The number of decimals which should be used in the sensor's state after rounding."
	UniqueId                  *string     `json:"unique_id,omitempty"`                   // "An ID that uniquely identifies this sensor. If two sensors have the same unique ID, Home Assistant will raise an exception."
	UnitOfMeasurement         *string     `json:"unit_of_measurement,omitempty"`         // "Defines the units of measurement of the sensor, if any."
	ValueTemplate             *string     `json:"value_template,omitempty"`              // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the value. If the template throws an error, the current state will be used instead."
	MQTT                      *MQTTFields `json:"-"`                                     // MQTT configuration parameters

	States *SensorState `json:"-"` // External state update location
	// contains filtered or unexported fields
}

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewSensor added in v0.2.0

func NewSensor(o *SensorOptions) (*Sensor, error)

func (*Sensor) AddMessageHandler

func (d *Sensor) AddMessageHandler()

func (*Sensor) AnnounceAvailable

func (d *Sensor) AnnounceAvailable()

func (*Sensor) DeleteTopic

func (d *Sensor) DeleteTopic()

func (*Sensor) GetDomainEntity added in v0.2.3

func (d *Sensor) GetDomainEntity() string

func (*Sensor) GetMQTTFields

func (d *Sensor) GetMQTTFields() (fields MQTTFields)

func (*Sensor) GetName

func (d *Sensor) GetName() string

func (*Sensor) GetRawId

func (d *Sensor) GetRawId() string

func (*Sensor) GetUniqueId

func (d *Sensor) GetUniqueId() string

func (*Sensor) Initialize

func (d *Sensor) Initialize()

func (*Sensor) JsonAttributes added in v0.2.1

func (d *Sensor) JsonAttributes(s string)

func (*Sensor) PopulateDevice

func (d *Sensor) PopulateDevice(Manufacturer string, SoftwareName string, InstanceName string, SWVersion string, Identifier string)

func (*Sensor) SetMQTTFields

func (d *Sensor) SetMQTTFields(fields MQTTFields)

func (*Sensor) State added in v0.2.1

func (d *Sensor) State(s string)

func (*Sensor) Subscribe

func (d *Sensor) Subscribe()

func (*Sensor) UnSubscribe

func (d *Sensor) UnSubscribe()

func (*Sensor) UpdateState

func (d *Sensor) UpdateState()

type SensorOptions added in v0.2.0

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

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewSensorOptions added in v0.2.0

func NewSensorOptions() *SensorOptions

func (*SensorOptions) AvailabilityFunc added in v0.2.0

func (o *SensorOptions) AvailabilityFunc(f func() string) *SensorOptions

func (*SensorOptions) AvailabilityMode added in v0.2.0

func (o *SensorOptions) AvailabilityMode(mode string) *SensorOptions

func (*SensorOptions) AvailabilityTemplate added in v0.2.0

func (o *SensorOptions) AvailabilityTemplate(template string) *SensorOptions

func (*SensorOptions) DeviceClass added in v0.2.0

func (o *SensorOptions) DeviceClass(class string) *SensorOptions

func (*SensorOptions) EnabledByDefault added in v0.2.0

func (o *SensorOptions) EnabledByDefault(d bool) *SensorOptions

func (*SensorOptions) Encoding added in v0.2.0

func (o *SensorOptions) Encoding(encoding string) *SensorOptions

func (*SensorOptions) EntityCategory added in v0.2.0

func (o *SensorOptions) EntityCategory(category string) *SensorOptions

func (*SensorOptions) ExpireAfter added in v0.2.0

func (o *SensorOptions) ExpireAfter(after int) *SensorOptions

func (*SensorOptions) ForceUpdate added in v0.2.0

func (o *SensorOptions) ForceUpdate(update bool) *SensorOptions

func (*SensorOptions) Icon added in v0.2.0

func (o *SensorOptions) Icon(icon string) *SensorOptions

func (*SensorOptions) JsonAttributesFunc added in v0.2.0

func (o *SensorOptions) JsonAttributesFunc(f func() string) *SensorOptions

func (*SensorOptions) JsonAttributesTemplate added in v0.2.0

func (o *SensorOptions) JsonAttributesTemplate(template string) *SensorOptions

func (*SensorOptions) LastResetValueTemplate added in v0.2.0

func (o *SensorOptions) LastResetValueTemplate(template string) *SensorOptions

func (*SensorOptions) Name added in v0.2.0

func (o *SensorOptions) Name(name string) *SensorOptions

func (*SensorOptions) ObjectId added in v0.2.0

func (o *SensorOptions) ObjectId(id string) *SensorOptions

func (*SensorOptions) PayloadAvailable added in v0.2.0

func (o *SensorOptions) PayloadAvailable(available string) *SensorOptions

func (*SensorOptions) PayloadNotAvailable added in v0.2.0

func (o *SensorOptions) PayloadNotAvailable(available string) *SensorOptions

func (*SensorOptions) Qos added in v0.2.0

func (o *SensorOptions) Qos(qos int) *SensorOptions

func (*SensorOptions) StateClass added in v0.2.0

func (o *SensorOptions) StateClass(class string) *SensorOptions

func (*SensorOptions) StateFunc added in v0.2.0

func (o *SensorOptions) StateFunc(f func() string) *SensorOptions

func (*SensorOptions) States added in v0.2.0

func (o *SensorOptions) States() *SensorState

func (*SensorOptions) SuggestedDisplayPrecision added in v0.2.0

func (o *SensorOptions) SuggestedDisplayPrecision(precision int) *SensorOptions

func (*SensorOptions) UniqueId added in v0.2.0

func (o *SensorOptions) UniqueId(id string) *SensorOptions

func (*SensorOptions) UnitOfMeasurement added in v0.2.0

func (o *SensorOptions) UnitOfMeasurement(measurement string) *SensorOptions

func (*SensorOptions) ValueTemplate added in v0.2.0

func (o *SensorOptions) ValueTemplate(template string) *SensorOptions

type SensorState added in v0.2.0

type SensorState struct {
	JsonAttributes string
	State          string
}

type Siren

type Siren struct {
	AvailabilityMode     *string `json:"availability_mode,omitempty"`     // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability."
	AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`."
	AvailabilityTopic    *string `json:"availability_topic,omitempty"`    // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`."

	AvailableTones     *([]string) `json:"available_tones,omitempty"`      // "A list of available tones the siren supports. When configured, this enables the support for setting a `tone` and enables the `tone` state attribute."
	CommandOffTemplate *string     `json:"command_off_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate a custom payload to send to `command_topic` when the siren turn off service is called. By default `command_template` will be used as template for service turn off. The variable `value` will be assigned with the configured `payload_off` setting."
	CommandTemplate    *string     `json:"command_template,omitempty"`     // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate a custom payload to send to `command_topic`. The variable `value` will be assigned with the configured `payload_on` or `payload_off` setting. The siren turn on service parameters `tone`, `volume_level` or `duration` can be used as variables in the template. When operation in optimistic mode the corresponding state attributes will be set. Turn on parameters will be filtered if a device misses the support."
	CommandTopic       *string     `json:"command_topic,omitempty"`        // "The MQTT topic to publish commands to change the siren state. Without command templates, a default JSON payload like `{\"state\":\"ON\", \"tone\": \"bell\", \"duration\": 10, \"volume_level\": 0.5 }` is published. When the siren turn on service is called, the startup parameters will be added to the JSON payload. The `state` value of the JSON payload will be set to the the `payload_on` or `payload_off` configured payload.\n"

	Device                 Device  `json:"device,omitempty"`                   // Device configuration parameters
	EnabledByDefault       *bool   `json:"enabled_by_default,omitempty"`       // "Flag which defines if the entity should be enabled when first added."
	Encoding               *string `json:"encoding,omitempty"`                 // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload."
	EntityCategory         *string `json:"entity_category,omitempty"`          // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity."
	Icon                   *string `json:"icon,omitempty"`                     // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity."
	JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation."
	JsonAttributesTopic    *string `json:"json_attributes_topic,omitempty"`    // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation."

	Name                *string `json:"name,omitempty"`                  // "The name to use when displaying this siren."
	ObjectId            *string `json:"object_id,omitempty"`             // "Used instead of `name` for automatic generation of `entity_id`"
	Optimistic          *bool   `json:"optimistic,omitempty"`            // "Flag that defines if siren works in optimistic mode."
	PayloadAvailable    *string `json:"payload_available,omitempty"`     // "The payload that represents the available state."
	PayloadNotAvailable *string `json:"payload_not_available,omitempty"` // "The payload that represents the unavailable state."
	PayloadOff          *string `json:"payload_off,omitempty"`           // "The payload that represents `off` state. If specified, will be used for both comparing to the value in the `state_topic` (see `value_template` and `state_off` for details) and sending as `off` command to the `command_topic`."
	PayloadOn           *string `json:"payload_on,omitempty"`            // "The payload that represents `on` state. If specified, will be used for both comparing to the value in the `state_topic` (see `value_template` and `state_on`  for details) and sending as `on` command to the `command_topic`."
	Qos                 *int    `json:"qos,omitempty"`                   // "The maximum QoS level of the state topic. Default is 0 and will also be used to publishing messages."
	Retain              *bool   `json:"retain,omitempty"`                // "If the published message should have the retain flag on or not."
	StateOff            *string `json:"state_off,omitempty"`             // "The payload that represents the `off` state. Used when value that represents `off` state in the `state_topic` is different from value that should be sent to the `command_topic` to turn the device `off`."
	StateOn             *string `json:"state_on,omitempty"`              // "The payload that represents the `on` state. Used when value that represents `on` state in the `state_topic` is different from value that should be sent to the `command_topic` to turn the device `on`."
	StateTopic          *string `json:"state_topic,omitempty"`           // "The MQTT topic subscribed to receive state updates. The state update may be either JSON or a simple string. When a JSON payload is detected, the `state` value of the JSON payload should supply the `payload_on` or `payload_off` defined payload to turn the siren on or off. Additionally, the state attributes `duration`, `tone` and `volume_level` can be updated. Use `value_template` to transform the received state udpate to a compliant JSON payload. Attributes will only be set if the function is supported by the device and a valid value is supplied. When a non JSON payload is detected, it should be either of the `payload_on` or `payload_off` defined payloads or `None` to reset the siren's state to `unknown`. The initial state will be `unknown`. The state will be reset to `unknown` if a `None` payload or `null` JSON value is received as a state update."

	StateValueTemplate *string     `json:"state_value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's state from the `state_topic`. To determine the siren's state result of this template will be compared to `state_on` and `state_off`. Alternatively `value_template` can be used to render to a valid JSON payload."
	SupportDuration    *bool       `json:"support_duration,omitempty"`     // "Set to `true` if the MQTT siren supports the `duration` service turn on parameter and enables the `duration` state attribute."
	SupportVolumeSet   *bool       `json:"support_volume_set,omitempty"`   // "Set to `true` if the MQTT siren supports the `volume_set` service turn on parameter and enables the `volume_level` state attribute."
	UniqueId           *string     `json:"unique_id,omitempty"`            // "An ID that uniquely identifies this siren device. If two sirens have the same unique ID, Home Assistant will raise an exception."
	MQTT               *MQTTFields `json:"-"`                              // MQTT configuration parameters

	States *SirenState `json:"-"` // External state update location
	// contains filtered or unexported fields
}

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewSiren added in v0.2.0

func NewSiren(o *SirenOptions) (*Siren, error)

func (*Siren) AddMessageHandler

func (d *Siren) AddMessageHandler()

func (*Siren) AnnounceAvailable

func (d *Siren) AnnounceAvailable()

func (*Siren) DeleteTopic

func (d *Siren) DeleteTopic()

func (*Siren) GetDomainEntity added in v0.2.3

func (d *Siren) GetDomainEntity() string

func (*Siren) GetMQTTFields

func (d *Siren) GetMQTTFields() (fields MQTTFields)

func (*Siren) GetName

func (d *Siren) GetName() string

func (*Siren) GetRawId

func (d *Siren) GetRawId() string

func (*Siren) GetUniqueId

func (d *Siren) GetUniqueId() string

func (*Siren) Initialize

func (d *Siren) Initialize()

func (*Siren) JsonAttributes added in v0.2.1

func (d *Siren) JsonAttributes(s string)

func (*Siren) PopulateDevice

func (d *Siren) PopulateDevice(Manufacturer string, SoftwareName string, InstanceName string, SWVersion string, Identifier string)

func (*Siren) SetMQTTFields

func (d *Siren) SetMQTTFields(fields MQTTFields)

func (*Siren) State added in v0.2.1

func (d *Siren) State(s string)

func (*Siren) Subscribe

func (d *Siren) Subscribe()

func (*Siren) UnSubscribe

func (d *Siren) UnSubscribe()

func (*Siren) UpdateState

func (d *Siren) UpdateState()

type SirenOptions added in v0.2.0

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

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewSirenOptions added in v0.2.0

func NewSirenOptions() *SirenOptions

func (*SirenOptions) AvailabilityFunc added in v0.2.0

func (o *SirenOptions) AvailabilityFunc(f func() string) *SirenOptions

func (*SirenOptions) AvailabilityMode added in v0.2.0

func (o *SirenOptions) AvailabilityMode(mode string) *SirenOptions

func (*SirenOptions) AvailabilityTemplate added in v0.2.0

func (o *SirenOptions) AvailabilityTemplate(template string) *SirenOptions

func (*SirenOptions) AvailableTones added in v0.2.0

func (o *SirenOptions) AvailableTones(tones []string) *SirenOptions

func (*SirenOptions) CommandFunc added in v0.2.0

func (o *SirenOptions) CommandFunc(f func(mqtt.Message, mqtt.Client)) *SirenOptions

func (*SirenOptions) CommandOffTemplate added in v0.2.0

func (o *SirenOptions) CommandOffTemplate(template string) *SirenOptions

func (*SirenOptions) CommandTemplate added in v0.2.0

func (o *SirenOptions) CommandTemplate(template string) *SirenOptions

func (*SirenOptions) EnabledByDefault added in v0.2.0

func (o *SirenOptions) EnabledByDefault(d bool) *SirenOptions

func (*SirenOptions) Encoding added in v0.2.0

func (o *SirenOptions) Encoding(encoding string) *SirenOptions

func (*SirenOptions) EntityCategory added in v0.2.0

func (o *SirenOptions) EntityCategory(category string) *SirenOptions

func (*SirenOptions) Icon added in v0.2.0

func (o *SirenOptions) Icon(icon string) *SirenOptions

func (*SirenOptions) JsonAttributesFunc added in v0.2.0

func (o *SirenOptions) JsonAttributesFunc(f func() string) *SirenOptions

func (*SirenOptions) JsonAttributesTemplate added in v0.2.0

func (o *SirenOptions) JsonAttributesTemplate(template string) *SirenOptions

func (*SirenOptions) Name added in v0.2.0

func (o *SirenOptions) Name(name string) *SirenOptions

func (*SirenOptions) ObjectId added in v0.2.0

func (o *SirenOptions) ObjectId(id string) *SirenOptions

func (*SirenOptions) Optimistic added in v0.2.0

func (o *SirenOptions) Optimistic(optimistic bool) *SirenOptions

func (*SirenOptions) PayloadAvailable added in v0.2.0

func (o *SirenOptions) PayloadAvailable(available string) *SirenOptions

func (*SirenOptions) PayloadNotAvailable added in v0.2.0

func (o *SirenOptions) PayloadNotAvailable(available string) *SirenOptions

func (*SirenOptions) PayloadOff added in v0.2.0

func (o *SirenOptions) PayloadOff(off string) *SirenOptions

func (*SirenOptions) PayloadOn added in v0.2.0

func (o *SirenOptions) PayloadOn(on string) *SirenOptions

func (*SirenOptions) Qos added in v0.2.0

func (o *SirenOptions) Qos(qos int) *SirenOptions

func (*SirenOptions) Retain added in v0.2.0

func (o *SirenOptions) Retain(retain bool) *SirenOptions

func (*SirenOptions) StateFunc added in v0.2.0

func (o *SirenOptions) StateFunc(f func() string) *SirenOptions

func (*SirenOptions) StateOff added in v0.2.0

func (o *SirenOptions) StateOff(off string) *SirenOptions

func (*SirenOptions) StateOn added in v0.2.0

func (o *SirenOptions) StateOn(on string) *SirenOptions

func (*SirenOptions) StateValueTemplate added in v0.2.0

func (o *SirenOptions) StateValueTemplate(template string) *SirenOptions

func (*SirenOptions) States added in v0.2.0

func (o *SirenOptions) States() *SirenState

func (*SirenOptions) SupportDuration added in v0.2.0

func (o *SirenOptions) SupportDuration(duration bool) *SirenOptions

func (*SirenOptions) SupportVolumeSet added in v0.2.0

func (o *SirenOptions) SupportVolumeSet(set bool) *SirenOptions

func (*SirenOptions) UniqueId added in v0.2.0

func (o *SirenOptions) UniqueId(id string) *SirenOptions

type SirenState added in v0.2.0

type SirenState struct {
	JsonAttributes string
	State          string
}

type StateStore

type StateStore struct {
	AlarmControlPanel struct {
		Mutex          *sync.Mutex
		Availability   map[string]string
		JsonAttributes map[string]string
		State          map[string]string
	}
	BinarySensor struct {
		Mutex          *sync.Mutex
		Availability   map[string]string
		JsonAttributes map[string]string
		State          map[string]string
	}
	Button struct {
		Mutex          *sync.Mutex
		Availability   map[string]string
		JsonAttributes map[string]string
	}
	Camera struct {
		Mutex          *sync.Mutex
		Availability   map[string]string
		JsonAttributes map[string]string
		State          map[string]string
	}
	Climate struct {
		Mutex                *sync.Mutex
		AuxState             map[string]string
		Availability         map[string]string
		CurrentHumidity      map[string]string
		CurrentTemperature   map[string]string
		FanModeState         map[string]string
		JsonAttributes       map[string]string
		ModeState            map[string]string
		PresetModeState      map[string]string
		SwingModeState       map[string]string
		TargetHumidityState  map[string]string
		TemperatureHighState map[string]string
		TemperatureLowState  map[string]string
		TemperatureState     map[string]string
	}
	DeviceTracker struct {
		Mutex          *sync.Mutex
		Availability   map[string]string
		JsonAttributes map[string]string
		State          map[string]string
	}
	DeviceTrigger struct {
		Mutex *sync.Mutex
		State map[string]string
	}
	Fan struct {
		Mutex            *sync.Mutex
		Availability     map[string]string
		JsonAttributes   map[string]string
		OscillationState map[string]string
		PercentageState  map[string]string
		PresetModeState  map[string]string
		State            map[string]string
	}
	Humidifier struct {
		Mutex               *sync.Mutex
		Availability        map[string]string
		JsonAttributes      map[string]string
		ModeState           map[string]string
		State               map[string]string
		TargetHumidityState map[string]string
	}
	Light struct {
		Mutex           *sync.Mutex
		Availability    map[string]string
		BrightnessState map[string]string
		ColorModeState  map[string]string
		ColorTempState  map[string]string
		EffectState     map[string]string
		HsState         map[string]string
		JsonAttributes  map[string]string
		RgbState        map[string]string
		RgbwState       map[string]string
		RgbwwState      map[string]string
		State           map[string]string
		XyState         map[string]string
	}
	Lock struct {
		Mutex          *sync.Mutex
		Availability   map[string]string
		JsonAttributes map[string]string
		State          map[string]string
	}
	Number struct {
		Mutex          *sync.Mutex
		Availability   map[string]string
		JsonAttributes map[string]string
		State          map[string]string
	}
	Scene struct {
		Mutex        *sync.Mutex
		Availability map[string]string
	}
	Select struct {
		Mutex          *sync.Mutex
		Availability   map[string]string
		JsonAttributes map[string]string
		State          map[string]string
	}
	Sensor struct {
		Mutex          *sync.Mutex
		Availability   map[string]string
		JsonAttributes map[string]string
		State          map[string]string
	}
	Siren struct {
		Mutex          *sync.Mutex
		Availability   map[string]string
		JsonAttributes map[string]string
		State          map[string]string
	}
	Switch struct {
		Mutex          *sync.Mutex
		Availability   map[string]string
		JsonAttributes map[string]string
		State          map[string]string
	}
	Tag struct {
		Mutex *sync.Mutex
		State map[string]string
	}
	Text struct {
		Mutex          *sync.Mutex
		Availability   map[string]string
		JsonAttributes map[string]string
		State          map[string]string
	}
	Update struct {
		Mutex          *sync.Mutex
		Availability   map[string]string
		JsonAttributes map[string]string
		State          map[string]string
	}
	Vacuum struct {
		Mutex          *sync.Mutex
		Availability   map[string]string
		JsonAttributes map[string]string
		State          map[string]string
	}
}

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

type Switch

type Switch struct {
	AvailabilityMode     *string `json:"availability_mode,omitempty"`     // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability."
	AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`."
	AvailabilityTopic    *string `json:"availability_topic,omitempty"`    // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`."

	CommandTopic *string `json:"command_topic,omitempty"` // "The MQTT topic to publish commands to change the switch state."

	Device                 Device  `json:"device,omitempty"`                   // Device configuration parameters
	DeviceClass            *string `json:"device_class,omitempty"`             // "The [type/class](/integrations/switch/#device-class) of the switch to set the icon in the frontend."
	EnabledByDefault       *bool   `json:"enabled_by_default,omitempty"`       // "Flag which defines if the entity should be enabled when first added."
	Encoding               *string `json:"encoding,omitempty"`                 // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload."
	EntityCategory         *string `json:"entity_category,omitempty"`          // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity."
	Icon                   *string `json:"icon,omitempty"`                     // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity."
	JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation."
	JsonAttributesTopic    *string `json:"json_attributes_topic,omitempty"`    // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation."

	Name                *string `json:"name,omitempty"`                  // "The name to use when displaying this switch."
	ObjectId            *string `json:"object_id,omitempty"`             // "Used instead of `name` for automatic generation of `entity_id`"
	Optimistic          *bool   `json:"optimistic,omitempty"`            // "Flag that defines if switch works in optimistic mode."
	PayloadAvailable    *string `json:"payload_available,omitempty"`     // "The payload that represents the available state."
	PayloadNotAvailable *string `json:"payload_not_available,omitempty"` // "The payload that represents the unavailable state."
	PayloadOff          *string `json:"payload_off,omitempty"`           // "The payload that represents `off` state. If specified, will be used for both comparing to the value in the `state_topic` (see `value_template` and `state_off` for details) and sending as `off` command to the `command_topic`."
	PayloadOn           *string `json:"payload_on,omitempty"`            // "The payload that represents `on` state. If specified, will be used for both comparing to the value in the `state_topic` (see `value_template` and `state_on`  for details) and sending as `on` command to the `command_topic`."
	Qos                 *int    `json:"qos,omitempty"`                   // "The maximum QoS level of the state topic. Default is 0 and will also be used to publishing messages."
	Retain              *bool   `json:"retain,omitempty"`                // "If the published message should have the retain flag on or not."
	StateOff            *string `json:"state_off,omitempty"`             // "The payload that represents the `off` state. Used when value that represents `off` state in the `state_topic` is different from value that should be sent to the `command_topic` to turn the device `off`."
	StateOn             *string `json:"state_on,omitempty"`              // "The payload that represents the `on` state. Used when value that represents `on` state in the `state_topic` is different from value that should be sent to the `command_topic` to turn the device `on`."
	StateTopic          *string `json:"state_topic,omitempty"`           // "The MQTT topic subscribed to receive state updates."

	UniqueId      *string     `json:"unique_id,omitempty"`      // "An ID that uniquely identifies this switch device. If two switches have the same unique ID, Home Assistant will raise an exception."
	ValueTemplate *string     `json:"value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's state from the `state_topic`. To determine the switches's state result of this template will be compared to `state_on` and `state_off`."
	MQTT          *MQTTFields `json:"-"`                        // MQTT configuration parameters

	States *SwitchState `json:"-"` // External state update location
	// contains filtered or unexported fields
}

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewSwitch added in v0.2.0

func NewSwitch(o *SwitchOptions) (*Switch, error)

func (*Switch) AddMessageHandler

func (d *Switch) AddMessageHandler()

func (*Switch) AnnounceAvailable

func (d *Switch) AnnounceAvailable()

func (*Switch) DeleteTopic

func (d *Switch) DeleteTopic()

func (*Switch) GetDomainEntity added in v0.2.3

func (d *Switch) GetDomainEntity() string

func (*Switch) GetMQTTFields

func (d *Switch) GetMQTTFields() (fields MQTTFields)

func (*Switch) GetName

func (d *Switch) GetName() string

func (*Switch) GetRawId

func (d *Switch) GetRawId() string

func (*Switch) GetUniqueId

func (d *Switch) GetUniqueId() string

func (*Switch) Initialize

func (d *Switch) Initialize()

func (*Switch) JsonAttributes added in v0.2.1

func (d *Switch) JsonAttributes(s string)

func (*Switch) PopulateDevice

func (d *Switch) PopulateDevice(Manufacturer string, SoftwareName string, InstanceName string, SWVersion string, Identifier string)

func (*Switch) SetMQTTFields

func (d *Switch) SetMQTTFields(fields MQTTFields)

func (*Switch) State added in v0.2.1

func (d *Switch) State(s string)

func (*Switch) Subscribe

func (d *Switch) Subscribe()

func (*Switch) UnSubscribe

func (d *Switch) UnSubscribe()

func (*Switch) UpdateState

func (d *Switch) UpdateState()

type SwitchOptions added in v0.2.0

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

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewSwitchOptions added in v0.2.0

func NewSwitchOptions() *SwitchOptions

func (*SwitchOptions) AvailabilityFunc added in v0.2.0

func (o *SwitchOptions) AvailabilityFunc(f func() string) *SwitchOptions

func (*SwitchOptions) AvailabilityMode added in v0.2.0

func (o *SwitchOptions) AvailabilityMode(mode string) *SwitchOptions

func (*SwitchOptions) AvailabilityTemplate added in v0.2.0

func (o *SwitchOptions) AvailabilityTemplate(template string) *SwitchOptions

func (*SwitchOptions) CommandFunc added in v0.2.0

func (o *SwitchOptions) CommandFunc(f func(mqtt.Message, mqtt.Client)) *SwitchOptions

func (*SwitchOptions) DeviceClass added in v0.2.0

func (o *SwitchOptions) DeviceClass(class string) *SwitchOptions

func (*SwitchOptions) EnabledByDefault added in v0.2.0

func (o *SwitchOptions) EnabledByDefault(d bool) *SwitchOptions

func (*SwitchOptions) Encoding added in v0.2.0

func (o *SwitchOptions) Encoding(encoding string) *SwitchOptions

func (*SwitchOptions) EntityCategory added in v0.2.0

func (o *SwitchOptions) EntityCategory(category string) *SwitchOptions

func (*SwitchOptions) Icon added in v0.2.0

func (o *SwitchOptions) Icon(icon string) *SwitchOptions

func (*SwitchOptions) JsonAttributesFunc added in v0.2.0

func (o *SwitchOptions) JsonAttributesFunc(f func() string) *SwitchOptions

func (*SwitchOptions) JsonAttributesTemplate added in v0.2.0

func (o *SwitchOptions) JsonAttributesTemplate(template string) *SwitchOptions

func (*SwitchOptions) Name added in v0.2.0

func (o *SwitchOptions) Name(name string) *SwitchOptions

func (*SwitchOptions) ObjectId added in v0.2.0

func (o *SwitchOptions) ObjectId(id string) *SwitchOptions

func (*SwitchOptions) Optimistic added in v0.2.0

func (o *SwitchOptions) Optimistic(optimistic bool) *SwitchOptions

func (*SwitchOptions) PayloadAvailable added in v0.2.0

func (o *SwitchOptions) PayloadAvailable(available string) *SwitchOptions

func (*SwitchOptions) PayloadNotAvailable added in v0.2.0

func (o *SwitchOptions) PayloadNotAvailable(available string) *SwitchOptions

func (*SwitchOptions) PayloadOff added in v0.2.0

func (o *SwitchOptions) PayloadOff(off string) *SwitchOptions

func (*SwitchOptions) PayloadOn added in v0.2.0

func (o *SwitchOptions) PayloadOn(on string) *SwitchOptions

func (*SwitchOptions) Qos added in v0.2.0

func (o *SwitchOptions) Qos(qos int) *SwitchOptions

func (*SwitchOptions) Retain added in v0.2.0

func (o *SwitchOptions) Retain(retain bool) *SwitchOptions

func (*SwitchOptions) StateFunc added in v0.2.0

func (o *SwitchOptions) StateFunc(f func() string) *SwitchOptions

func (*SwitchOptions) StateOff added in v0.2.0

func (o *SwitchOptions) StateOff(off string) *SwitchOptions

func (*SwitchOptions) StateOn added in v0.2.0

func (o *SwitchOptions) StateOn(on string) *SwitchOptions

func (*SwitchOptions) States added in v0.2.0

func (o *SwitchOptions) States() *SwitchState

func (*SwitchOptions) UniqueId added in v0.2.0

func (o *SwitchOptions) UniqueId(id string) *SwitchOptions

func (*SwitchOptions) ValueTemplate added in v0.2.0

func (o *SwitchOptions) ValueTemplate(template string) *SwitchOptions

type SwitchState added in v0.2.0

type SwitchState struct {
	JsonAttributes string
	State          string
}

type Tag

type Tag struct {
	Device     Device  `json:"device,omitempty"` // Device configuration parameters
	StateTopic *string `json:"topic,omitempty"`  // "The MQTT topic subscribed to receive tag scanned events."

	ValueTemplate *string     `json:"value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) that returns a tag ID."
	MQTT          *MQTTFields `json:"-"`                        // MQTT configuration parameters

	States *TagState `json:"-"` // External state update location
	// contains filtered or unexported fields
}

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewTag added in v0.2.0

func NewTag(o *TagOptions) (*Tag, error)

func (*Tag) AddMessageHandler

func (d *Tag) AddMessageHandler()

func (*Tag) AnnounceAvailable

func (d *Tag) AnnounceAvailable()

func (*Tag) DeleteTopic

func (d *Tag) DeleteTopic()

func (Tag) GetDomainEntity added in v0.2.3

func (d Tag) GetDomainEntity() string

func (*Tag) GetMQTTFields

func (d *Tag) GetMQTTFields() (fields MQTTFields)

func (Tag) GetName

func (d Tag) GetName() string

func (*Tag) GetRawId

func (d *Tag) GetRawId() string

func (Tag) GetUniqueId

func (d Tag) GetUniqueId() string

func (*Tag) Initialize

func (d *Tag) Initialize()

func (*Tag) PopulateDevice

func (d *Tag) PopulateDevice(Manufacturer string, SoftwareName string, InstanceName string, SWVersion string, Identifier string)

func (*Tag) SetMQTTFields

func (d *Tag) SetMQTTFields(fields MQTTFields)

func (*Tag) State added in v0.2.1

func (d *Tag) State(s string)

func (*Tag) Subscribe

func (d *Tag) Subscribe()

func (*Tag) UnSubscribe

func (d *Tag) UnSubscribe()

func (*Tag) UpdateState

func (d *Tag) UpdateState()

type TagOptions added in v0.2.0

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

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewTagOptions added in v0.2.0

func NewTagOptions() *TagOptions

func (*TagOptions) StateFunc added in v0.2.0

func (o *TagOptions) StateFunc(f func() string) *TagOptions

func (*TagOptions) States added in v0.2.0

func (o *TagOptions) States() *TagState

func (*TagOptions) ValueTemplate added in v0.2.0

func (o *TagOptions) ValueTemplate(template string) *TagOptions

type TagState added in v0.2.0

type TagState struct {
	State string
}

type Text

type Text struct {
	AvailabilityMode     *string `json:"availability_mode,omitempty"`     // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability."
	AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`."
	AvailabilityTopic    *string `json:"availability_topic,omitempty"`    // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`."

	CommandTemplate *string `json:"command_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to generate the payload to send to `command_topic`."
	CommandTopic    *string `json:"command_topic,omitempty"`    // "The MQTT topic to publish the text value that is set."

	Device                 Device  `json:"device,omitempty"`                   // Device configuration parameters
	EnabledByDefault       *bool   `json:"enabled_by_default,omitempty"`       // "Flag which defines if the entity should be enabled when first added."
	Encoding               *string `json:"encoding,omitempty"`                 // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload."
	EntityCategory         *string `json:"entity_category,omitempty"`          // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity."
	JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`."
	JsonAttributesTopic    *string `json:"json_attributes_topic,omitempty"`    // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as entity attributes. Implies `force_update` of the current select state when a message is received on this topic."

	Max        *int    `json:"max,omitempty"`         // "The maximum size of a text being set or received (maximum is 255)."
	Min        *int    `json:"min,omitempty"`         // "The minimum size of a text being set or received."
	Mode       *string `json:"mode,omitempty"`        // "The mode off the text entity. Must be either `text` or `password`."
	Name       *string `json:"name,omitempty"`        // "The name of the text entity."
	ObjectId   *string `json:"object_id,omitempty"`   // "Used instead of `name` for automatic generation of `entity_id`"
	Pattern    *string `json:"pattern,omitempty"`     // "A valid regular expression the text being set or received must match with."
	Qos        *int    `json:"qos,omitempty"`         // "The maximum QoS level of the state topic. Default is 0 and will also be used to publishing messages."
	Retain     *bool   `json:"retain,omitempty"`      // "If the published message should have the retain flag on or not."
	StateTopic *string `json:"state_topic,omitempty"` // "The MQTT topic subscribed to receive text state updates. Text state updates should match the `pattern` (if set) and meet the size constraints `min` and `max`. Can be used with `value_template` to render the incoming payload to a text update."

	UniqueId      *string     `json:"unique_id,omitempty"`      // "An ID that uniquely identifies this Select. If two Selects have the same unique ID Home Assistant will raise an exception."
	ValueTemplate *string     `json:"value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the text state value from the payload received on `state_topic`."
	MQTT          *MQTTFields `json:"-"`                        // MQTT configuration parameters

	States *TextState `json:"-"` // External state update location
	// contains filtered or unexported fields
}

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewText added in v0.2.0

func NewText(o *TextOptions) (*Text, error)

func (*Text) AddMessageHandler

func (d *Text) AddMessageHandler()

func (*Text) AnnounceAvailable

func (d *Text) AnnounceAvailable()

func (*Text) DeleteTopic

func (d *Text) DeleteTopic()

func (*Text) GetDomainEntity added in v0.2.3

func (d *Text) GetDomainEntity() string

func (*Text) GetMQTTFields

func (d *Text) GetMQTTFields() (fields MQTTFields)

func (*Text) GetName

func (d *Text) GetName() string

func (*Text) GetRawId

func (d *Text) GetRawId() string

func (*Text) GetUniqueId

func (d *Text) GetUniqueId() string

func (*Text) Initialize

func (d *Text) Initialize()

func (*Text) JsonAttributes added in v0.2.1

func (d *Text) JsonAttributes(s string)

func (*Text) PopulateDevice

func (d *Text) PopulateDevice(Manufacturer string, SoftwareName string, InstanceName string, SWVersion string, Identifier string)

func (*Text) SetMQTTFields

func (d *Text) SetMQTTFields(fields MQTTFields)

func (*Text) State added in v0.2.1

func (d *Text) State(s string)

func (*Text) Subscribe

func (d *Text) Subscribe()

func (*Text) UnSubscribe

func (d *Text) UnSubscribe()

func (*Text) UpdateState

func (d *Text) UpdateState()

type TextOptions added in v0.2.0

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

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewTextOptions added in v0.2.0

func NewTextOptions() *TextOptions

func (*TextOptions) AvailabilityFunc added in v0.2.0

func (o *TextOptions) AvailabilityFunc(f func() string) *TextOptions

func (*TextOptions) AvailabilityMode added in v0.2.0

func (o *TextOptions) AvailabilityMode(mode string) *TextOptions

func (*TextOptions) AvailabilityTemplate added in v0.2.0

func (o *TextOptions) AvailabilityTemplate(template string) *TextOptions

func (*TextOptions) CommandFunc added in v0.2.0

func (o *TextOptions) CommandFunc(f func(mqtt.Message, mqtt.Client)) *TextOptions

func (*TextOptions) CommandTemplate added in v0.2.0

func (o *TextOptions) CommandTemplate(template string) *TextOptions

func (*TextOptions) EnabledByDefault added in v0.2.0

func (o *TextOptions) EnabledByDefault(d bool) *TextOptions

func (*TextOptions) Encoding added in v0.2.0

func (o *TextOptions) Encoding(encoding string) *TextOptions

func (*TextOptions) EntityCategory added in v0.2.0

func (o *TextOptions) EntityCategory(category string) *TextOptions

func (*TextOptions) JsonAttributesFunc added in v0.2.0

func (o *TextOptions) JsonAttributesFunc(f func() string) *TextOptions

func (*TextOptions) JsonAttributesTemplate added in v0.2.0

func (o *TextOptions) JsonAttributesTemplate(template string) *TextOptions

func (*TextOptions) Max added in v0.2.0

func (o *TextOptions) Max(max int) *TextOptions

func (*TextOptions) Min added in v0.2.0

func (o *TextOptions) Min(min int) *TextOptions

func (*TextOptions) Mode added in v0.2.0

func (o *TextOptions) Mode(mode string) *TextOptions

func (*TextOptions) Name added in v0.2.0

func (o *TextOptions) Name(name string) *TextOptions

func (*TextOptions) ObjectId added in v0.2.0

func (o *TextOptions) ObjectId(id string) *TextOptions

func (*TextOptions) Pattern added in v0.2.0

func (o *TextOptions) Pattern(pattern string) *TextOptions

func (*TextOptions) Qos added in v0.2.0

func (o *TextOptions) Qos(qos int) *TextOptions

func (*TextOptions) Retain added in v0.2.0

func (o *TextOptions) Retain(retain bool) *TextOptions

func (*TextOptions) StateFunc added in v0.2.0

func (o *TextOptions) StateFunc(f func() string) *TextOptions

func (*TextOptions) States added in v0.2.0

func (o *TextOptions) States() *TextState

func (*TextOptions) UniqueId added in v0.2.0

func (o *TextOptions) UniqueId(id string) *TextOptions

func (*TextOptions) ValueTemplate added in v0.2.0

func (o *TextOptions) ValueTemplate(template string) *TextOptions

type TextState added in v0.2.0

type TextState struct {
	JsonAttributes string
	State          string
}

type Topic added in v0.2.0

type Topic struct {
	Topic         string  `json:"topic"`
	ValueTemplate *string `json:"value_template"`
}

func NewTopic added in v0.2.0

func NewTopic(topic string, valueTemplate string) Topic

func (Topic) MarshalJSON added in v0.2.0

func (t Topic) MarshalJSON() ([]byte, error)

type Update

type Update struct {
	AvailabilityMode     *string `json:"availability_mode,omitempty"`     // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability."
	AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`."
	AvailabilityTopic    *string `json:"availability_topic,omitempty"`    // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`."

	CommandTopic *string `json:"command_topic,omitempty"` // "The MQTT topic to publish `payload_install` to start installing process."

	Device                 Device  `json:"device,omitempty"`                   // Device configuration parameters
	DeviceClass            *string `json:"device_class,omitempty"`             // "The [type/class](/integrations/update/#device-classes) of the update to set the icon in the frontend."
	EnabledByDefault       *bool   `json:"enabled_by_default,omitempty"`       // "Flag which defines if the entity should be enabled when first added."
	Encoding               *string `json:"encoding,omitempty"`                 // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload."
	EntityCategory         *string `json:"entity_category,omitempty"`          // "The [category](https://developers.home-assistant.io/docs/core/entity#generic-properties) of the entity."
	EntityPicture          *string `json:"entity_picture,omitempty"`           // "Picture URL for the entity."
	Icon                   *string `json:"icon,omitempty"`                     // "[Icon](/docs/configuration/customizing-devices/#icon) for the entity."
	JsonAttributesTemplate *string `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`."
	JsonAttributesTopic    *string `json:"json_attributes_topic,omitempty"`    // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as entity attributes. Implies `force_update` of the current select state when a message is received on this topic."

	LatestVersionTemplate *string `json:"latest_version_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the latest version value."
	LatestVersionTopic    *string `json:"latest_version_topic,omitempty"`    // "The MQTT topic subscribed to receive an update of the latest version."

	Name           *string `json:"name,omitempty"`            // "The name of the Select."
	ObjectId       *string `json:"object_id,omitempty"`       // "Used instead of `name` for automatic generation of `entity_id`"
	PayloadInstall *string `json:"payload_install,omitempty"` // "The MQTT payload to start installing process."
	Qos            *int    `json:"qos,omitempty"`             // "The maximum QoS level of the state topic. Default is 0 and will also be used to publishing messages."
	ReleaseSummary *string `json:"release_summary,omitempty"` // "Summary of the release notes or changelog. This is suitable a brief update description of max 255 characters."
	ReleaseUrl     *string `json:"release_url,omitempty"`     // "URL to the full release notes of the latest version available."
	Retain         *bool   `json:"retain,omitempty"`          // "If the published message should have the retain flag on or not."
	StateTopic     *string `json:"state_topic,omitempty"`     // "The MQTT topic subscribed to receive state updates. The state update may be either JSON or a simple string with `installed_version` value. When a JSON payload is detected, the state value of the JSON payload should supply the `installed_version` and can optional supply: `latest_version`, `title`, `release_summary`, `release_url` or an `entity_picture` URL."

	Title         *string     `json:"title,omitempty"`          // "Title of the software, or firmware update. This helps to differentiate between the device or entity name versus the title of the software installed."
	UniqueId      *string     `json:"unique_id,omitempty"`      // "An ID that uniquely identifies this Select. If two Selects have the same unique ID Home Assistant will raise an exception."
	ValueTemplate *string     `json:"value_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the `installed_version` state value or to render to a valid JSON payload on from the payload received on `state_topic`."
	MQTT          *MQTTFields `json:"-"`                        // MQTT configuration parameters

	States *UpdateState `json:"-"` // External state update location
	// contains filtered or unexported fields
}

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewUpdate added in v0.2.0

func NewUpdate(o *UpdateOptions) (*Update, error)

func (*Update) AddMessageHandler

func (d *Update) AddMessageHandler()

func (*Update) AnnounceAvailable

func (d *Update) AnnounceAvailable()

func (*Update) DeleteTopic

func (d *Update) DeleteTopic()

func (*Update) GetDomainEntity added in v0.2.3

func (d *Update) GetDomainEntity() string

func (*Update) GetMQTTFields

func (d *Update) GetMQTTFields() (fields MQTTFields)

func (*Update) GetName

func (d *Update) GetName() string

func (*Update) GetRawId

func (d *Update) GetRawId() string

func (*Update) GetUniqueId

func (d *Update) GetUniqueId() string

func (*Update) Initialize

func (d *Update) Initialize()

func (*Update) JsonAttributes added in v0.2.1

func (d *Update) JsonAttributes(s string)

func (*Update) PopulateDevice

func (d *Update) PopulateDevice(Manufacturer string, SoftwareName string, InstanceName string, SWVersion string, Identifier string)

func (*Update) SetMQTTFields

func (d *Update) SetMQTTFields(fields MQTTFields)

func (*Update) State added in v0.2.1

func (d *Update) State(s string)

func (*Update) Subscribe

func (d *Update) Subscribe()

func (*Update) UnSubscribe

func (d *Update) UnSubscribe()

func (*Update) UpdateState

func (d *Update) UpdateState()

type UpdateOptions added in v0.2.0

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

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewUpdateOptions added in v0.2.0

func NewUpdateOptions() *UpdateOptions

func (*UpdateOptions) AvailabilityFunc added in v0.2.0

func (o *UpdateOptions) AvailabilityFunc(f func() string) *UpdateOptions

func (*UpdateOptions) AvailabilityMode added in v0.2.0

func (o *UpdateOptions) AvailabilityMode(mode string) *UpdateOptions

func (*UpdateOptions) AvailabilityTemplate added in v0.2.0

func (o *UpdateOptions) AvailabilityTemplate(template string) *UpdateOptions

func (*UpdateOptions) CommandFunc added in v0.2.0

func (o *UpdateOptions) CommandFunc(f func(mqtt.Message, mqtt.Client)) *UpdateOptions

func (*UpdateOptions) DeviceClass added in v0.2.0

func (o *UpdateOptions) DeviceClass(class string) *UpdateOptions

func (*UpdateOptions) EnabledByDefault added in v0.2.0

func (o *UpdateOptions) EnabledByDefault(d bool) *UpdateOptions

func (*UpdateOptions) Encoding added in v0.2.0

func (o *UpdateOptions) Encoding(encoding string) *UpdateOptions

func (*UpdateOptions) EntityCategory added in v0.2.0

func (o *UpdateOptions) EntityCategory(category string) *UpdateOptions

func (*UpdateOptions) EntityPicture added in v0.2.0

func (o *UpdateOptions) EntityPicture(picture string) *UpdateOptions

func (*UpdateOptions) Icon added in v0.2.0

func (o *UpdateOptions) Icon(icon string) *UpdateOptions

func (*UpdateOptions) JsonAttributesFunc added in v0.2.0

func (o *UpdateOptions) JsonAttributesFunc(f func() string) *UpdateOptions

func (*UpdateOptions) JsonAttributesTemplate added in v0.2.0

func (o *UpdateOptions) JsonAttributesTemplate(template string) *UpdateOptions

func (*UpdateOptions) LatestVersionFunc added in v0.2.0

func (o *UpdateOptions) LatestVersionFunc(f func(mqtt.Message, mqtt.Client)) *UpdateOptions

func (*UpdateOptions) LatestVersionTemplate added in v0.2.0

func (o *UpdateOptions) LatestVersionTemplate(template string) *UpdateOptions

func (*UpdateOptions) Name added in v0.2.0

func (o *UpdateOptions) Name(name string) *UpdateOptions

func (*UpdateOptions) ObjectId added in v0.2.0

func (o *UpdateOptions) ObjectId(id string) *UpdateOptions

func (*UpdateOptions) PayloadInstall added in v0.2.0

func (o *UpdateOptions) PayloadInstall(install string) *UpdateOptions

func (*UpdateOptions) Qos added in v0.2.0

func (o *UpdateOptions) Qos(qos int) *UpdateOptions

func (*UpdateOptions) ReleaseSummary added in v0.2.0

func (o *UpdateOptions) ReleaseSummary(summary string) *UpdateOptions

func (*UpdateOptions) ReleaseUrl added in v0.2.0

func (o *UpdateOptions) ReleaseUrl(url string) *UpdateOptions

func (*UpdateOptions) Retain added in v0.2.0

func (o *UpdateOptions) Retain(retain bool) *UpdateOptions

func (*UpdateOptions) StateFunc added in v0.2.0

func (o *UpdateOptions) StateFunc(f func() string) *UpdateOptions

func (*UpdateOptions) States added in v0.2.0

func (o *UpdateOptions) States() *UpdateState

func (*UpdateOptions) Title added in v0.2.0

func (o *UpdateOptions) Title(title string) *UpdateOptions

func (*UpdateOptions) UniqueId added in v0.2.0

func (o *UpdateOptions) UniqueId(id string) *UpdateOptions

func (*UpdateOptions) ValueTemplate added in v0.2.0

func (o *UpdateOptions) ValueTemplate(template string) *UpdateOptions

type UpdateState added in v0.2.0

type UpdateState struct {
	JsonAttributes string
	State          string
}

type Vacuum

type Vacuum struct {
	AvailabilityMode     *string `json:"availability_mode,omitempty"`     // "When `availability` is configured, this controls the conditions needed to set the entity to `available`. Valid entries are `all`, `any`, and `latest`. If set to `all`, `payload_available` must be received on all configured availability topics before the entity is marked as online. If set to `any`, `payload_available` must be received on at least one configured availability topic before the entity is marked as online. If set to `latest`, the last `payload_available` or `payload_not_available` received on any configured availability topic controls the availability."
	AvailabilityTemplate *string `json:"availability_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract device's availability from the `availability_topic`. To determine the devices's availability result of this template will be compared to `payload_available` and `payload_not_available`."
	AvailabilityTopic    *string `json:"availability_topic,omitempty"`    // "The MQTT topic subscribed to receive availability (online/offline) updates. Must not be used together with `availability`."

	CommandTopic *string `json:"command_topic,omitempty"` // "The MQTT topic to publish commands to control the vacuum."

	Device                 Device      `json:"device,omitempty"`                   // Device configuration parameters
	Encoding               *string     `json:"encoding,omitempty"`                 // "The encoding of the payloads received and published messages. Set to `\"\"` to disable decoding of incoming payload."
	FanSpeedList           *([]string) `json:"fan_speed_list,omitempty"`           // "List of possible fan speeds for the vacuum."
	JsonAttributesTemplate *string     `json:"json_attributes_template,omitempty"` // "Defines a [template](/docs/configuration/templating/#using-templates-with-the-mqtt-integration) to extract the JSON dictionary from messages received on the `json_attributes_topic`. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-template-configuration) documentation."
	JsonAttributesTopic    *string     `json:"json_attributes_topic,omitempty"`    // "The MQTT topic subscribed to receive a JSON dictionary payload and then set as sensor attributes. Usage example can be found in [MQTT sensor](/integrations/sensor.mqtt/#json-attributes-topic-configuration) documentation."

	Name                *string `json:"name,omitempty"`                   // "The name of the vacuum."
	ObjectId            *string `json:"object_id,omitempty"`              // "Used instead of `name` for automatic generation of `entity_id`"
	PayloadAvailable    *string `json:"payload_available,omitempty"`      // "The payload that represents the available state."
	PayloadCleanSpot    *string `json:"payload_clean_spot,omitempty"`     // "The payload to send to the `command_topic` to begin a spot cleaning cycle."
	PayloadLocate       *string `json:"payload_locate,omitempty"`         // "The payload to send to the `command_topic` to locate the vacuum (typically plays a song)."
	PayloadNotAvailable *string `json:"payload_not_available,omitempty"`  // "The payload that represents the unavailable state."
	PayloadPause        *string `json:"payload_pause,omitempty"`          // "The payload to send to the `command_topic` to pause the vacuum."
	PayloadReturnToBase *string `json:"payload_return_to_base,omitempty"` // "The payload to send to the `command_topic` to tell the vacuum to return to base."
	PayloadStart        *string `json:"payload_start,omitempty"`          // "The payload to send to the `command_topic` to begin the cleaning cycle."
	PayloadStop         *string `json:"payload_stop,omitempty"`           // "The payload to send to the `command_topic` to stop cleaning."
	Qos                 *int    `json:"qos,omitempty"`                    // "The maximum QoS level of the state topic."
	Retain              *bool   `json:"retain,omitempty"`                 // "If the published message should have the retain flag on or not."
	Schema              *string `json:"schema,omitempty"`                 // "The schema to use. Must be `state` to select the state schema."
	SendCommandTopic    *string `json:"send_command_topic,omitempty"`     // "The MQTT topic to publish custom commands to the vacuum."

	SetFanSpeedTopic *string `json:"set_fan_speed_topic,omitempty"` // "The MQTT topic to publish commands to control the vacuum's fan speed."

	StateTopic *string `json:"state_topic,omitempty"` // "The MQTT topic subscribed to receive state messages from the vacuum. Messages received on the `state_topic` must be a valid JSON dictionary, with a mandatory `state` key and optionally `battery_level` and `fan_speed` keys as shown in the [example](#state-mqtt-protocol)."

	SupportedFeatures *([]string) `json:"supported_features,omitempty"` // "List of features that the vacuum supports (possible values are `start`, `stop`, `pause`, `return_home`, `battery`, `status`, `locate`, `clean_spot`, `fan_speed`, `send_command`)."
	UniqueId          *string     `json:"unique_id,omitempty"`          // "An ID that uniquely identifies this vacuum. If two vacuums have the same unique ID, Home Assistant will raise an exception."
	MQTT              *MQTTFields `json:"-"`                            // MQTT configuration parameters

	States *VacuumState `json:"-"` // External state update location
	// contains filtered or unexported fields
}

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewVacuum added in v0.2.0

func NewVacuum(o *VacuumOptions) (*Vacuum, error)

func (*Vacuum) AddMessageHandler

func (d *Vacuum) AddMessageHandler()

func (*Vacuum) AnnounceAvailable

func (d *Vacuum) AnnounceAvailable()

func (*Vacuum) DeleteTopic

func (d *Vacuum) DeleteTopic()

func (*Vacuum) GetDomainEntity added in v0.2.3

func (d *Vacuum) GetDomainEntity() string

func (*Vacuum) GetMQTTFields

func (d *Vacuum) GetMQTTFields() (fields MQTTFields)

func (*Vacuum) GetName

func (d *Vacuum) GetName() string

func (*Vacuum) GetRawId

func (d *Vacuum) GetRawId() string

func (*Vacuum) GetUniqueId

func (d *Vacuum) GetUniqueId() string

func (*Vacuum) Initialize

func (d *Vacuum) Initialize()

func (*Vacuum) JsonAttributes added in v0.2.1

func (d *Vacuum) JsonAttributes(s string)

func (*Vacuum) PopulateDevice

func (d *Vacuum) PopulateDevice(Manufacturer string, SoftwareName string, InstanceName string, SWVersion string, Identifier string)

func (*Vacuum) SetMQTTFields

func (d *Vacuum) SetMQTTFields(fields MQTTFields)

func (*Vacuum) State added in v0.2.1

func (d *Vacuum) State(s string)

func (*Vacuum) Subscribe

func (d *Vacuum) Subscribe()

func (*Vacuum) UnSubscribe

func (d *Vacuum) UnSubscribe()

func (*Vacuum) UpdateState

func (d *Vacuum) UpdateState()

type VacuumOptions added in v0.2.0

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

////////////////////////////////////////////////////////////////////////////// Do not modify this file, it is automatically generated //////////////////////////////////////////////////////////////////////////////

func NewVacuumOptions added in v0.2.0

func NewVacuumOptions() *VacuumOptions

func (*VacuumOptions) AvailabilityFunc added in v0.2.0

func (o *VacuumOptions) AvailabilityFunc(f func() string) *VacuumOptions

func (*VacuumOptions) AvailabilityMode added in v0.2.0

func (o *VacuumOptions) AvailabilityMode(mode string) *VacuumOptions

func (*VacuumOptions) AvailabilityTemplate added in v0.2.0

func (o *VacuumOptions) AvailabilityTemplate(template string) *VacuumOptions

func (*VacuumOptions) CommandFunc added in v0.2.0

func (o *VacuumOptions) CommandFunc(f func(mqtt.Message, mqtt.Client)) *VacuumOptions

func (*VacuumOptions) Encoding added in v0.2.0

func (o *VacuumOptions) Encoding(encoding string) *VacuumOptions

func (*VacuumOptions) FanSpeedList added in v0.2.0

func (o *VacuumOptions) FanSpeedList(list []string) *VacuumOptions

func (*VacuumOptions) JsonAttributesFunc added in v0.2.0

func (o *VacuumOptions) JsonAttributesFunc(f func() string) *VacuumOptions

func (*VacuumOptions) JsonAttributesTemplate added in v0.2.0

func (o *VacuumOptions) JsonAttributesTemplate(template string) *VacuumOptions

func (*VacuumOptions) Name added in v0.2.0

func (o *VacuumOptions) Name(name string) *VacuumOptions

func (*VacuumOptions) ObjectId added in v0.2.0

func (o *VacuumOptions) ObjectId(id string) *VacuumOptions

func (*VacuumOptions) PayloadAvailable added in v0.2.0

func (o *VacuumOptions) PayloadAvailable(available string) *VacuumOptions

func (*VacuumOptions) PayloadCleanSpot added in v0.2.0

func (o *VacuumOptions) PayloadCleanSpot(spot string) *VacuumOptions

func (*VacuumOptions) PayloadLocate added in v0.2.0

func (o *VacuumOptions) PayloadLocate(locate string) *VacuumOptions

func (*VacuumOptions) PayloadNotAvailable added in v0.2.0

func (o *VacuumOptions) PayloadNotAvailable(available string) *VacuumOptions

func (*VacuumOptions) PayloadPause added in v0.2.0

func (o *VacuumOptions) PayloadPause(pause string) *VacuumOptions

func (*VacuumOptions) PayloadReturnToBase added in v0.2.0

func (o *VacuumOptions) PayloadReturnToBase(base string) *VacuumOptions

func (*VacuumOptions) PayloadStart added in v0.2.0

func (o *VacuumOptions) PayloadStart(start string) *VacuumOptions

func (*VacuumOptions) PayloadStop added in v0.2.0

func (o *VacuumOptions) PayloadStop(stop string) *VacuumOptions

func (*VacuumOptions) Qos added in v0.2.0

func (o *VacuumOptions) Qos(qos int) *VacuumOptions

func (*VacuumOptions) Retain added in v0.2.0

func (o *VacuumOptions) Retain(retain bool) *VacuumOptions

func (*VacuumOptions) Schema added in v0.2.0

func (o *VacuumOptions) Schema(schema string) *VacuumOptions

func (*VacuumOptions) SendCommandFunc added in v0.2.0

func (o *VacuumOptions) SendCommandFunc(f func(mqtt.Message, mqtt.Client)) *VacuumOptions

func (*VacuumOptions) SetFanSpeedFunc added in v0.2.0

func (o *VacuumOptions) SetFanSpeedFunc(f func(mqtt.Message, mqtt.Client)) *VacuumOptions

func (*VacuumOptions) StateFunc added in v0.2.0

func (o *VacuumOptions) StateFunc(f func() string) *VacuumOptions

func (*VacuumOptions) States added in v0.2.0

func (o *VacuumOptions) States() *VacuumState

func (*VacuumOptions) SupportedFeatures added in v0.2.0

func (o *VacuumOptions) SupportedFeatures(features []string) *VacuumOptions

func (*VacuumOptions) UniqueId added in v0.2.0

func (o *VacuumOptions) UniqueId(id string) *VacuumOptions

type VacuumState added in v0.2.0

type VacuumState struct {
	JsonAttributes string
	State          string
}

Jump to

Keyboard shortcuts

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