hk

package
v0.0.0-...-5ef72e9 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package hk provides various types and helpers for Apple HomeKit® related entities.

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidCode = fmt.Errorf("invalid setup code")

ErrInvalidCode can be returned when the Code is not valid.

View Source
var ErrInvalidID = fmt.Errorf("invalid setup id")

ErrInvalidID can be returned when the ID is not valid.

Functions

This section is empty.

Types

type Category

type Category uint8

Category represents an Apple HomeKit® accessory category.

const (
	CategoryUnknown            Category = iota // Unknown
	CategoryOther                              // Other
	CategoryBridge                             // Bridge
	CategoryFan                                // Fan
	CategoryGarageDoorOpener                   // Garage Door Opener
	CategoryLightbulb                          // Lightbulb
	CategoryDoorLock                           // Door Lock
	CategoryOutlet                             // Outlet
	CategorySwitch                             // Switch
	CategoryThermostat                         // Thermostat
	CategorySensor                             // Sensor
	CategorySecuritySystem                     // Security System
	CategoryDoor                               // Door
	CategoryWindow                             // Window
	CategoryWindowCovering                     // Window Covering
	CategoryProgrammableSwitch                 // Programmable Switch

	CategoryIPCamera       // IP Camera
	CategoryVideoDoorbell  // Video Doorbell
	CategoryAirPurifier    // Air Purifier
	CategoryHeater         // Heater
	CategoryAirConditioner // Air Conditioner
	CategoryHumidifier     // Humidifier
	CategoryDehumidifier   // Dehumidifier

	CategorySprinklers    // Sprinklers
	CategoryFaucets       // Faucets
	CategoryShowerSystems // Shower Systems

)

All available accessory categories.

func (Category) String

func (i Category) String() string

type Code

type Code uint32

Code represents an Apple HomeKit® setup code.

func (Code) Format

func (c Code) Format() string

Format returns the code in the Apple preferred format XXX-XX-XXX. If the code is not valid, it returns an empty string.

func (Code) String

func (c Code) String() string

String returns a string representation of the code.

Implements fmt.Stringer.

func (Code) Valid

func (c Code) Valid() bool

Valid returns true if the code is valid, false otherwise. Valid codes are between and including 0 and 99999999.

type Flag

type Flag uint8

Flag represents an Apple HomeKit® setup flag. Setup flags indicate the supported pairing methods. However, Apple devices seem to ignore them and it doesn't matter which flags are set, if even.

const (
	FlagNone Flag = 0         // <none>
	FlagNFC  Flag = 1 << iota // NFC
	FlagIP                    // IP
	FlagBTLE                  // BTLE

)

All available setup flags.

func (Flag) String

func (f Flag) String() string

String returns a string representation of the flag.

It implements fmt.Stringer.

type ID

type ID string

ID represents an Apple HomeKit® setup id.

func (ID) String

func (id ID) String() string

String returns a string representation of the code. All characters are uppercased.

Implements fmt.Stringer.

func (ID) Valid

func (id ID) Valid() bool

Valid returns true if the id is valid, false otherwise. Valid ids have 4 digits.

Directories

Path Synopsis
Package qr implements the creation of QR code based Apple HomeKit® setup codes and the respective payloads.
Package qr implements the creation of QR code based Apple HomeKit® setup codes and the respective payloads.
Package text implements the creation of text based Apple HomeKit® setup codes.
Package text implements the creation of text based Apple HomeKit® setup codes.

Jump to

Keyboard shortcuts

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