Documentation
¶
Index ¶
- func CalculateSunTimesWithTwilight(lat, lon float64, date time.Time, elevTwilight, elevDaylight float64) (SunTimes, SunCondition)
- func FetchIPLocation() (*float64, *float64, error)
- func HandleRequest(conn net.Conn, req models.Request, manager *Manager)
- func MemfdCreate(name string, flags int) (int, error)
- type Config
- type GammaRamp
- type GammaState
- type Manager
- func (m *Manager) ClearManualTimes()
- func (m *Manager) Close()
- func (m *Manager) GetState() State
- func (m *Manager) SetConfig(config Config) error
- func (m *Manager) SetEnabled(enabled bool)
- func (m *Manager) SetGamma(gamma float64) error
- func (m *Manager) SetLocation(lat, lon float64) error
- func (m *Manager) SetManualTimes(sunrise, sunset time.Time) error
- func (m *Manager) SetTemperature(low, high int) error
- func (m *Manager) SetUseIPLocation(use bool)
- func (m *Manager) Subscribe(id string) chan State
- func (m *Manager) Unsubscribe(id string)
- type State
- type SunCondition
- type SunTimes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchIPLocation ¶
Types ¶
type Config ¶
type Config struct {
Outputs []string
LowTemp int
HighTemp int
Latitude *float64
Longitude *float64
UseIPLocation bool
ManualSunrise *time.Time
ManualSunset *time.Time
ManualDuration *time.Duration
Gamma float64
Enabled bool
ElevationTwilight float64
ElevationDaylight float64
}
func DefaultConfig ¶
func DefaultConfig() Config
type GammaRamp ¶
func GenerateIdentityRamp ¶
type GammaState ¶
type GammaState int
const ( StateNormal GammaState = iota StateTransition StateStatic )
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(display wlclient.WaylandDisplay, config Config) (*Manager, error)
func (*Manager) ClearManualTimes ¶
func (m *Manager) ClearManualTimes()
func (*Manager) SetEnabled ¶
func (*Manager) SetLocation ¶
func (*Manager) SetTemperature ¶
func (*Manager) SetUseIPLocation ¶
func (*Manager) Unsubscribe ¶
type State ¶
type State struct {
Config Config `json:"config"`
CurrentTemp int `json:"currentTemp"`
NextTransition time.Time `json:"nextTransition"`
SunriseTime time.Time `json:"sunriseTime"`
SunsetTime time.Time `json:"sunsetTime"`
DawnTime time.Time `json:"dawnTime"`
NightTime time.Time `json:"nightTime"`
IsDay bool `json:"isDay"`
SunPosition float64 `json:"sunPosition"`
}
type SunCondition ¶
type SunCondition int
const ( SunNormal SunCondition = iota SunMidnightSun SunPolarNight )
Click to show internal directories.
Click to hide internal directories.