alarm

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: May 2, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AlarmClient

type AlarmClient interface {
	GetPartialStatus(ctx context.Context) (response *StatusResponse, err error)
	GetZones(ctx context.Context, all bool) ([]ZoneModel, error)
}

AlarmClient is the client interface

func NewClient

func NewClient(host, port, password string) (client AlarmClient)

NewClient returns client for communicating with the server through a tcp connection

type Battery

type Battery struct {
	Low              bool
	AbsentOrInverted bool
	ShortCircuit     bool
}

Battery is the status for the given battery

type Central

type Central struct {
	Model                     string
	Firmware                  string
	Battery                   Battery
	Activated                 bool
	Alerting                  bool
	IssueWarn                 bool // central has some issue
	ExternalPowerFault        bool // central loss external power source
	ExternalAuxOverload       bool // external auxiliary exit overload
	PhoneLineCut              bool
	EventCommunicationFailure bool
	Siren                     Siren
}

Central is all the information relative to the central collected from the partial status command

type Client

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

Client is the client for communicating with the alarm central

func (*Client) GetPartialStatus

func (c *Client) GetPartialStatus(ctx context.Context) (response *StatusResponse, err error)

GetPartialStatus get the partial status from the Central

func (*Client) GetZones

func (c *Client) GetZones(ctx context.Context, all bool) ([]ZoneModel, error)

GetZones returns Zone statuses in a simple abstraction

type Keyboard

type Keyboard struct {
	ReceiverIssue bool
	Issue         bool // keyboard has some issue
	Tamper        bool
}

Keyboard is the status of a keyboard

type PGM

type PGM struct {
	Enabled bool
}

PGM indicates the status of given PGM

type Partition

type Partition struct {
	Enabled bool
}

Partition indicates the status of given partition

type Siren

type Siren struct {
	Enabled      bool
	WireCut      bool
	ShortCircuit bool
}

Siren is the status of the siren

type StatusResponse

type StatusResponse struct {
	Date             time.Time
	Zones            []Zone
	Keyboards        []Keyboard
	Central          Central
	PGMs             []PGM
	Partitions       []Partition
	PartitionEnabled bool
}

StatusResponse is all the information collected from the partial status command

type Zone

type Zone struct {
	Violated     bool
	Anulated     bool
	Open         bool
	LowBattery   bool // not implemented
	ShortCircuit bool // not implemented
	Tamper       bool // not implemented
}

Zone is the raw zone status collected from the alarm central

type ZoneDescription

type ZoneDescription struct {
	Id          int    `yaml:"id"`
	Name        string `yaml:"name"`
	Description string `yaml:"description"`
}

ZoneDescription a configuration to add contextual metadata to Zones

type ZoneModel

type ZoneModel struct {
	Id     int
	Name   string
	Status string
}

ZoneModel is a simple abstraction for Zone status

Directories

Path Synopsis
Package mock_alarm is a generated GoMock package.
Package mock_alarm is a generated GoMock package.

Jump to

Keyboard shortcuts

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