fulfilment

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2022 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package fulfillment implements a server that responds to Google Smart Home "fulfilment" requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AvailableFanSpeeds

type AvailableFanSpeeds struct {
	Speeds  []FanSpeedSetting `json:"speeds"`
	Ordered bool              `json:"ordered"`
}

type FanSpeedAttributes

type FanSpeedAttributes struct {
	// If set to true, this device supports blowing the fan in both directions
	// and can accept the command to reverse fan direction.
	Reversible bool `json:"reversible"`

	// Indicates if the device supports using one-way (true) or two-way (false)
	// communication. Set this attribute to true if the device cannot respond to
	// a QUERY intent or Report State for this trait.
	CommandOnlyFanSpeed bool `json:"commandOnlyFanSpeed"`

	// If set to true, this device will accept commands for adjusting the speed
	// using a percentage from 0.0 to 100.0.
	SupportsFanSpeedPercent bool `json:"supportsFanSpeedPercent"`

	// List of available fan speeds.
	AvailableFanSpeeds AvailableFanSpeeds `json:"availableFanSpeeds"`
}

Attributes for the FanSpeed attribute, "action.devices.traits.FanSpeed".

Described here: https://developers.google.com/assistant/smarthome/traits/fanspeed.

func (*FanSpeedAttributes) AddToDevice

func (a *FanSpeedAttributes) AddToDevice(dev *smarthome.Device)

AddToDevice adds the attributes to the given Device object.

func (*FanSpeedAttributes) TraitName

func (a *FanSpeedAttributes) TraitName() TraitName

type FanSpeedSetting

type FanSpeedSetting struct {
	SpeedName   string          `json:"speed_name"`
	SpeedValues []FanSpeedValue `json:"speed_values"`
}

type FanSpeedState

type FanSpeedState struct {
	CurrentFanSpeedSetting string `json:"currentFanSpeedSetting"`
	CurrentFanSpeedPercent int    `json:"currentFanSpeedPercent"`
}

type FanSpeedValue

type FanSpeedValue struct {
	SpeedSynonym []string `json:"speed_synonym"`
	Lang         string   `json:"lang"`
}

type Service

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

func NewService

func NewService(psc *pubsub.Client, ssc cpb.StateServiceClient) *Service

func (*Service) DebugHandler

func (s *Service) DebugHandler() http.Handler

DebugHandler returns a handler for debug requests.

func (*Service) GoogleFulfillmentHandler

func (s *Service) GoogleFulfillmentHandler() http.Handler

GoogleFulfillmentHandler returns a handler for fulfillment requests.

type SetFanSpeedNameCommand

type SetFanSpeedNameCommand struct {
	// The request fan speed name.
	FanSpeed string `json:"fanSpeed"`
}

type SetFanSpeedPercentCommand

type SetFanSpeedPercentCommand struct {
	// The requested speed setting percentage.
	FanSpeedPercent float32 `json:"fanSpeedPercent"`
}

type TraitName

type TraitName string

ID of a device trait name, like action.devices.traits.FanSpeed.

Jump to

Keyboard shortcuts

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