Documentation ¶
Overview ¶
Package controller implements the handler interfaces to access the model.
Index ¶
- type CharacteristicController
- func (ctr *CharacteristicController) GetCharacteristic(aid int64, iid int64) *characteristic.Characteristic
- func (ctr *CharacteristicController) HandleGetCharacteristics(form url.Values) (io.Reader, error)
- func (ctr *CharacteristicController) HandleUpdateCharacteristics(r io.Reader, conn net.Conn) error
- type ContainerController
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CharacteristicController ¶
type CharacteristicController struct {
// contains filtered or unexported fields
}
CharacteristicController implements the CharacteristicsHandler interface and provides read (GET) and write (POST) interfaces to the managed characteristics.
func NewCharacteristicController ¶
func NewCharacteristicController(m *accessory.Container) *CharacteristicController
NewCharacteristicController returns a new characteristic controller.
func (*CharacteristicController) GetCharacteristic ¶
func (ctr *CharacteristicController) GetCharacteristic(aid int64, iid int64) *characteristic.Characteristic
GetCharacteristic returns the characteristic identified by the accessory id aid and characteristic id iid
func (*CharacteristicController) HandleGetCharacteristics ¶
HandleGetCharacteristics handles a get characteristic request like `/characteristics?id=1.4,1.5`
func (*CharacteristicController) HandleUpdateCharacteristics ¶
HandleUpdateCharacteristics handles an update characteristic request. The bytes must represent a data.Characteristics json.
type ContainerController ¶
type ContainerController struct {
// contains filtered or unexported fields
}
ContainerController implements the AccessoriesHandler interface.
func NewContainerController ¶
func NewContainerController(m *accessory.Container) *ContainerController
NewContainerController returns a controller for the argument container.
func (*ContainerController) HandleGetAccessories ¶
HandleGetAccessories returns the container as json bytes.
func (*ContainerController) IdentifyAccessory ¶
func (ctr *ContainerController) IdentifyAccessory()
IdentifyAccessory calls Identify() for all accessories.