satel

package module
v0.0.0-...-7ac13d8 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2024 License: MIT Imports: 11 Imported by: 0

README

go-satel

go-satel is a Go library to integrate with Satel ETHM-1/ETHM-1 Plus module

builds.sr.ht status Go Report Card

The library is based on https://github.com/probakowski/go-satel .

Installation

go-satel is compatible with modern Go releases in module mode, with Go installed:

go get git.sr.ht/~michalr/go-satel

will resolve and add the package to the current development module, along with its dependencies.

Alternatively the same can be achieved if you use import in a package:

import "git.sr.ht/~michalr/go-satel"

and run go get without parameters.

Usage

TODO

Documentation

Index

Constants

View Source
const (
	SatelCommand_zonesViolation                 = 0x00
	SatelCommand_zonesTamper                    = 0x01
	SatelCommand_zonesAlarm                     = 0x02
	SatelCommand_zonesTamperAlarm               = 0x03
	SatelCommand_zonesAlarmMemory               = 0x04
	SatelCommand_zonesTamperAlarmMemory         = 0x05
	SatelCommand_zonesBypass                    = 0x06
	SatelCommand_zonesNoViolationTrouble        = 0x07
	SatelCommand_zonesLongViolationTrouble      = 0x08
	SatelCommand_armedPartitionsSuppressed      = 0x09
	SatelCommand_armedPartitionsReally          = 0x0A
	SatelCommand_partitionsArmedOnMode2         = 0x0B
	SatelCommand_partitionsArmedOnMode3         = 0x0C
	SatelCommand_partitionsWith1stCodeEntered   = 0x0D
	SatelCommand_partitionsEntryTime            = 0x0E
	SatelCommand_partitionsExitTimeMoreThan10s  = 0x0F
	SatelCommand_partitionsExitTimeLessThan10s  = 0x10
	SatelCommand_partitionsTemporaryBlocked     = 0x11
	SatelCommand_partitionsBlockedForGuardRound = 0x12
	SatelCommand_partitionsAlarm                = 0x13
	SatelCommand_partitionsFireAlarm            = 0x14
	SatelCommand_partitionsAlarmMemory          = 0x15
	SatelCommand_partitionsFireAlarmMemory      = 0x16
	SatelCommand_outputsState                   = 0x17
	SatelCommand_doorsOpened                    = 0x18
	SatelCommand_doorsOpenedLong                = 0x19
	SatelCommand_RTCAndBasicStatusBits          = 0x1A
	SatelCommand_troublesPart1                  = 0x1B
	SatelCommand_troublesPart2                  = 0x1C
	SatelCommand_troublesPart3                  = 0x1D
	SatelCommand_troublesPart4                  = 0x1E
	SatelCommand_troublesPart5                  = 0x1F
	SatelCommand_troublesMemoryPart1            = 0x20
	SatelCommand_troublesMemoryPart2            = 0x21
	SatelCommand_troublesMemoryPart3            = 0x22
	SatelCommand_troublesMemoryPart4            = 0x23
	SatelCommand_troublesMemoryPart5            = 0x24
	SatelCommand_partitionsWithViolatedZones    = 0x25
	SatelCommand_zonesIsolate                   = 0x26
	SatelCommand_partitionsWithVerifiedAlarms   = 0x27
	SatelCommand_zonesMasked                    = 0x28
	SatelCommand_zonesMaskedMemory              = 0x29
	SatelCommand_partitionsArmedOnMode1         = 0x2A
	SatelCommand_partitionsWithWarningAlarms    = 0x2B
	SatelCommand_troublesPart6                  = 0x2C
	SatelCommand_troublesPart7                  = 0x2D
	SatelCommand_troublesMemoryPart6            = 0x2E
	SatelCommand_troublesMemoryPart7            = 0x2F
	SatelCommand_troublesPart8                  = 0x30
	SatelCommand_troublesMemoryPart8            = 0x31

	SatelCommand_ReadDeviceName = 0xEE

	Satel_Result = 0xEF
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicEventElement

type BasicEventElement struct {
	Type  ChangeType
	Index int
	Value bool
}

type ChangeType

type ChangeType byte
const (
	ZoneViolation ChangeType = iota
	ZoneTamper
	ZoneAlarm
	ZoneTamperAlarm
	ZoneAlarmMemory
	ZoneTamperAlarmMemory
	ZoneBypass
	ZoneNoViolationTrouble
	ZoneLongViolationTrouble
	ArmedPartitionSuppressed
	ArmedPartition
	PartitionArmedInMode2
	PartitionArmedInMode3
	PartitionWith1stCodeEntered
	PartitionEntryTime
	PartitionExitTimeOver10s
	PartitionExitTimeUnder10s
	PartitionTemporaryBlocked
	PartitionBlockedForGuardRound
	PartitionAlarm
	PartitionFireAlarm
	PartitionAlarmMemory
	PartitionFireAlarmMemory
	Output
	DoorOpened
	DoorOpenedLong
	StatusBit
	TroublePart1
	TroublePart2
	TroublePart3
	TroublePart4
	TroublePart5
	TroubleMemoryPart1
	TroubleMemoryPart2
	TroubleMemoryPart3
	TroubleMemoryPart4
	TroubleMemoryPart5
	PartitionWithViolatedZones
	ZoneIsolate
)

func (ChangeType) String

func (c ChangeType) String() string

type Config

type Config struct {
	EventsQueueSize int
	LongCommands    bool
	PoolingInterval time.Duration
}

type DeviceType

type DeviceType byte
const (
	DeviceType_Partition                               DeviceType = 0
	DeviceType_Zone                                    DeviceType = 1
	DeviceType_User                                    DeviceType = 2
	DeviceType_ExpanderOrLCD                           DeviceType = 3
	DeviceType_Output                                  DeviceType = 4
	DeviceType_ZoneWithPartitionAssignment             DeviceType = 5
	DeviceType_Timer                                   DeviceType = 6
	DeviceType_Telephone                               DeviceType = 7
	DeviceType_Object                                  DeviceType = 15
	DeviceType_PartitionWithObjectAssignment           DeviceType = 16
	DeviceType_OutputWithDurationTime                  DeviceType = 17
	DeviceType_PartitionWithObjectAssignmentAndOptions DeviceType = 18
)

type Event

type Event struct {
	BasicEvents []BasicEventElement
}

type NameEvent

type NameEvent struct {
	DevType         DeviceType
	DevNumber       byte
	DevTypeFunction byte
	DevName         string
}

type Satel

type Satel struct {
	Events chan Event
	// contains filtered or unexported fields
}

func New

func New(conn net.Conn) *Satel

func NewConfig

func NewConfig(conn net.Conn, config Config) *Satel

func (*Satel) ArmPartition

func (s *Satel) ArmPartition(code string, mode, index int) error

func (*Satel) Close

func (s *Satel) Close() error

func (*Satel) DisarmPartition

func (s *Satel) DisarmPartition(code string, index int) error

func (*Satel) ForceArmPartition

func (s *Satel) ForceArmPartition(code string, mode, index int) error

func (*Satel) GetName

func (s *Satel) GetName(devType DeviceType, devIndex byte) (*NameEvent, error)

func (*Satel) SetOutput

func (s *Satel) SetOutput(code string, index int, value bool) error

Jump to

Keyboard shortcuts

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