Documentation
¶
Index ¶
- Constants
- Variables
- func GenerateColorFromString(seedPhrase string) lipgloss.Color
- type AutoMoLi
- type Config
- type Room
- func (r *Room) FmtShort() string
- func (r *Room) FmtString() string
- func (r *Room) FormatDaytimeConfiguration(daytime *daytime.Daytime) string
- func (r *Room) GetActiveDaytime() *daytime.Daytime
- func (r *Room) GetActiveDelay() time.Duration
- func (r *Room) GetFmtRoomConfig() string
- func (r *Room) IsHumidityAboveThreshold() bool
- func (r *Room) String() string
Constants ¶
View Source
const ASCIIHeader = `` /* 1121-byte string literal not displayed */
Variables ¶
View Source
var ( AppName = "AutoMoLi" AppIcon = icons.LightOn AppVersion = "dev" CommitDate = "unknown" Commit = "none" )
Functions ¶
func GenerateColorFromString ¶
GenerateColorFromString generates a color based on the given seed.
Types ¶
type AutoMoLi ¶
type Config ¶
type Config struct {
// DisabledBy is a map of entities that control the state of AutoMoLi
// if any entity is in state 'off' - AutoMoLi will be treated as 'off' too (won't react to any events)
DisabledBy map[homeassistant.EntityID][]string `mapstructure:"disabled_by,omitempty"`
// StatsInterval is the interval in which the stats ticker will print the stats line
StatsInterval time.Duration `mapstructure:"stats_interval,omitempty"`
// LightConfiguration is the default light configuration for all rooms
daytime.LightConfiguration `mapstructure:",squash"`
}
type Room ¶
type Room struct {
Name string `json:"name" mapstructure:"name"`
// LightConfiguration is the default light configuration for this room
daytime.LightConfiguration `mapstructure:",squash"`
Lights []homeassistant.EntityID `json:"lights" mapstructure:"lights"`
MotionSensors []homeassistant.EntityID `json:"motion_sensors" mapstructure:"motion_sensors"`
MotionStateOn string `json:"motion_state_on,omitempty" mapstructure:"motion_state_on,omitempty"`
MotionStateOff string `json:"motion_state_off,omitempty" mapstructure:"motion_state_off,omitempty"`
// sensors & threshold for humidity check
HumiditySensors []homeassistant.EntityID `json:"humidity_sensors,omitempty" mapstructure:"humidity_sensors,omitempty"`
HumidityThreshold *uint8 `json:"humidity_threshold,omitempty" mapstructure:"humidity_threshold,omitempty"`
// daytimes
Daytimes []*daytime.Daytime `json:"daytimes" mapstructure:"daytimes"`
EventsChannel chan *homeassistant.EventMsg
TriggerEvents mapset.Set[homeassistant.EventType]
// mutex to prevent concurrent access to the room
sync.Mutex
// contains filtered or unexported fields
}
func (*Room) FormatDaytimeConfiguration ¶
func (*Room) GetActiveDaytime ¶
func (*Room) GetActiveDelay ¶
func (*Room) GetFmtRoomConfig ¶
func (*Room) IsHumidityAboveThreshold ¶
IsHumidityAboveThreshold checks if any humidity sensor in the room is above the threshold.
Click to show internal directories.
Click to hide internal directories.