Documentation ¶
Index ¶
- Constants
- Variables
- func AsFloat32Pointer(u BoundedUnit) *float32
- func Clamp(u BoundedUnit) float64
- func CreateFileWithoutOverwrite(fpath string) (*os.File, string, error)
- func IsUndefined(u BoundedUnit) bool
- func MapPriority(f AlarmFlags) int
- func VersionAreCompatible(a, b string) (bool, error)
- func ZoneIdentifier(host, name string) string
- type Alarm
- type AlarmEvent
- type AlarmFlags
- type AlarmStatus
- type AlarmString
- type BoundedUnit
- type ClimateInterpoler
- type ClimateReport
- type ClimateTarget
- type DeviceInternalError
- func (e DeviceInternalError) Description() string
- func (e DeviceInternalError) Device() (string, arke.NodeClass, arke.NodeID)
- func (e DeviceInternalError) ErrorCode() uint16
- func (e DeviceInternalError) Flags() AlarmFlags
- func (e DeviceInternalError) Identifier() string
- func (e DeviceInternalError) MinDownTime() time.Duration
- func (e DeviceInternalError) MinUpTime() time.Duration
- type FanAlarm
- type Humidity
- type Interpolation
- type Light
- type MissingDeviceAlarm
- func (a MissingDeviceAlarm) Description() string
- func (a MissingDeviceAlarm) Device() (string, arke.NodeClass, arke.NodeID)
- func (a MissingDeviceAlarm) Flags() AlarmFlags
- func (a MissingDeviceAlarm) Identifier() string
- func (a MissingDeviceAlarm) MinDownTime() time.Duration
- func (a MissingDeviceAlarm) MinUpTime() time.Duration
- type NamedClimateReport
- type SeasonFile
- type State
- type Temperature
- type Transition
- type Wind
- type ZoneClimate
- type ZoneRegistration
- type ZoneUnregistration
Constants ¶
View Source
const ( Warning AlarmFlags = 0x00 Emergency = 0x01 Failure = 0x02 AdminOnly = 0x04 )
View Source
const HeartBeatPeriod = 5 * time.Second
View Source
const StatePeriod = 5 * time.Second
View Source
const ZEUS_PORT = 4011
Variables ¶
View Source
var ClimateStateUndefined = AlarmString{Warning, "climate.undefined", "Climate State Undefined", 10 * time.Second, 2 * time.Second}
View Source
var HumidityUnreachable = AlarmString{Warning, "climate.humidity.unreachable", "Cannot reach desired humidity", 20 * time.Minute, 10 * time.Minute}
View Source
var SensorReadoutIssue = AlarmString{Failure, "climate.sensor.readout", "Cannot read sensors", 1 * time.Minute, 2 * time.Second}
View Source
var TemperatureUnreachable = AlarmString{Warning, "climate.temperature.unreachable", "Cannot reach desired temperature", 20 * time.Minute, 10 * time.Minute}
View Source
var UndefinedHumidity = Humidity(math.Inf(-1))
View Source
var UndefinedLight = Light(math.Inf(-1))
View Source
var UndefinedTemperature = Temperature(math.Inf(-1))
View Source
var UndefinedWind = Wind(math.Inf(-1))
View Source
var WaterLevelCritical = AlarmString{Failure, "climate.water_level", "Water tank is empty", 2 * time.Minute, 1 * time.Minute}
View Source
var WaterLevelUnreadable = AlarmString{Failure, "climate.water_sensor", "Celaeno cannot determine water tank level", 2 * time.Minute, 1 * time.Minute}
View Source
var WaterLevelWarning = AlarmString{Emergency, "climate.water_level", "Water tank level is low", 2 * time.Minute, 1 * time.Minute}
View Source
var ZEUS_VERSION = "v0.4.0"
Current package version
Functions ¶
func AsFloat32Pointer ¶
func AsFloat32Pointer(u BoundedUnit) *float32
func Clamp ¶
func Clamp(u BoundedUnit) float64
func IsUndefined ¶
func IsUndefined(u BoundedUnit) bool
func MapPriority ¶
func MapPriority(f AlarmFlags) int
func VersionAreCompatible ¶
Tests if two version strings are compatible.
func ZoneIdentifier ¶
Types ¶
type Alarm ¶
type Alarm interface { Flags() AlarmFlags Identifier() string Description() string MinUpTime() time.Duration MinDownTime() time.Duration }
func NewAlarmString ¶
func NewAlarmString(flags AlarmFlags, identifier, description string, minUp, minDown time.Duration) Alarm
func OutOfBound ¶
func OutOfBound[T Temperature | Humidity](min, max T) Alarm
type AlarmEvent ¶
type AlarmEvent struct { ZoneIdentifier string Identifier string Description string Flags AlarmFlags Status AlarmStatus Time time.Time }
type AlarmFlags ¶
type AlarmFlags int
type AlarmString ¶
type AlarmString struct {
// contains filtered or unexported fields
}
func (AlarmString) Description ¶
func (a AlarmString) Description() string
func (AlarmString) Flags ¶
func (a AlarmString) Flags() AlarmFlags
func (AlarmString) Identifier ¶
func (a AlarmString) Identifier() string
func (AlarmString) MinDownTime ¶
func (a AlarmString) MinDownTime() time.Duration
func (AlarmString) MinUpTime ¶
func (a AlarmString) MinUpTime() time.Duration
type BoundedUnit ¶
type ClimateInterpoler ¶
type ClimateInterpoler interface {
CurrentInterpolation(t time.Time) (Interpolation, time.Time, Interpolation)
}
func NewClimateInterpoler ¶
func NewClimateInterpoler(states []State, transitions []Transition, reference time.Time) (ClimateInterpoler, error)
type ClimateReport ¶
type ClimateReport struct { Temperatures []Temperature Humidity Humidity Time time.Time }
func (ClimateReport) Check ¶
func (r ClimateReport) Check() error
type ClimateTarget ¶
type DeviceInternalError ¶
type DeviceInternalError struct {
// contains filtered or unexported fields
}
func NewDeviceInternalError ¶
func (DeviceInternalError) Description ¶
func (e DeviceInternalError) Description() string
func (DeviceInternalError) ErrorCode ¶
func (e DeviceInternalError) ErrorCode() uint16
func (DeviceInternalError) Flags ¶
func (e DeviceInternalError) Flags() AlarmFlags
func (DeviceInternalError) Identifier ¶
func (e DeviceInternalError) Identifier() string
func (DeviceInternalError) MinDownTime ¶
func (e DeviceInternalError) MinDownTime() time.Duration
func (DeviceInternalError) MinUpTime ¶
func (e DeviceInternalError) MinUpTime() time.Duration
type FanAlarm ¶
type FanAlarm struct {
// contains filtered or unexported fields
}
func NewFanAlarm ¶
func NewFanAlarm(fan string, s arke.FanStatus, level AlarmFlags) FanAlarm
func (FanAlarm) Description ¶
func (FanAlarm) Flags ¶
func (a FanAlarm) Flags() AlarmFlags
func (FanAlarm) Identifier ¶
func (FanAlarm) MinDownTime ¶
type Interpolation ¶
type MissingDeviceAlarm ¶
type MissingDeviceAlarm struct {
// contains filtered or unexported fields
}
func NewMissingDeviceAlarm ¶
func (MissingDeviceAlarm) Description ¶
func (a MissingDeviceAlarm) Description() string
func (MissingDeviceAlarm) Flags ¶
func (a MissingDeviceAlarm) Flags() AlarmFlags
func (MissingDeviceAlarm) Identifier ¶
func (a MissingDeviceAlarm) Identifier() string
func (MissingDeviceAlarm) MinDownTime ¶
func (a MissingDeviceAlarm) MinDownTime() time.Duration
func (MissingDeviceAlarm) MinUpTime ¶
func (a MissingDeviceAlarm) MinUpTime() time.Duration
type NamedClimateReport ¶
type NamedClimateReport struct { ClimateReport ZoneIdentifier string }
type SeasonFile ¶
type SeasonFile struct {
Zones map[string]ZoneClimate
}
func ParseSeasonFile ¶
func ParseSeasonFile(content []byte) (*SeasonFile, error)
func ReadSeasonFile ¶
func ReadSeasonFile(filename string, writer io.Writer) (*SeasonFile, error)
func (SeasonFile) WriteFile ¶
func (f SeasonFile) WriteFile(filename string) error
type State ¶
type State struct { Name string Temperature Temperature Humidity Humidity Wind Wind VisibleLight Light UVLight Light }
func (State) AsPbTarget ¶
func (State) MarshalYAML ¶
func (*State) UnmarshalYAML ¶
type Temperature ¶
type Temperature float64
func (Temperature) MaxValue ¶
func (t Temperature) MaxValue() float64
func (Temperature) MinValue ¶
func (t Temperature) MinValue() float64
func (Temperature) Value ¶
func (t Temperature) Value() float64
type Transition ¶
type Transition struct {
From, To string
Duration time.Duration
Start time.Time
StartTimeDelta time.Duration
Day int
}
func (*Transition) Check ¶
func (t *Transition) Check() error
func (Transition) MarshalYAML ¶
func (t Transition) MarshalYAML() (interface{}, error)
func (Transition) String ¶
func (t Transition) String() string
func (*Transition) UnmarshalYAML ¶
func (t *Transition) UnmarshalYAML(unmarshal func(interface{}) error) error
type ZoneClimate ¶
type ZoneClimate struct { MinimalTemperature Temperature `yaml:"minimal-temperature,omitempty"` MaximalTemperature Temperature `yaml:"maximal-temperature,omitempty"` MinimalHumidity Humidity `yaml:"minimal-humidity,omitempty"` MaximalHumidity Humidity `yaml:"maximal-humidity,omitempty"` States []State Transitions []Transition }
type ZoneRegistration ¶
type ZoneRegistration struct { Host string Name string MinTemperature *float64 MaxTemperature *float64 MinHumidity *float64 MaxHumidity *float64 NumAux int RPCAddress string SizeClimateLog, SizeAlarmLog int }
func (ZoneRegistration) ZoneIdentifier ¶
func (zr ZoneRegistration) ZoneIdentifier() string
type ZoneUnregistration ¶
func (ZoneUnregistration) ZoneIdentifer ¶
func (zr ZoneUnregistration) ZoneIdentifer() string
Click to show internal directories.
Click to hide internal directories.