Documentation ¶
Index ¶
- Constants
- func ToggleLock(config Config, key string) (err error)
- type Calendar
- type CalendarConfig
- type CalendarEntry
- type CalendarEvent
- type Config
- type CurrentWeather
- type ForecastWeather
- type GlobalConfig
- type HomeAssistant
- type HomeAssistantConfig
- type Lock
- type LockConfig
- type LockPayload
- type LockState
- type SchoolBusConfig
- type SchoolCafe
- type SchoolCafeItem
- type SchoolLunchConfig
- type SchoolMenu
- type SchoolMenuItem
- type Sun
- type SunConfig
- type SunState
- type Trash
- type TrashConfig
- type TravelConfig
- type TravelState
- type TravelTime
- type Weather
- type WeatherConfig
- type WeatherState
Constants ¶
View Source
const ( SchoolCafeEntree = "ENTREE" SchoolCafeDaily = "DAILY OFFERINGS" SchoolCafeGrain = "GRAIN" SchoolCafeVegetable = "VEGETABLE" SchoolCafeFruit = "FRUIT" SchoolCafeMilk = "MILK" )
View Source
const (
SchoolCafeMealTypeLunch = "Lunch"
)
Variables ¶
This section is empty.
Functions ¶
func ToggleLock ¶
Types ¶
type Calendar ¶
type Calendar struct { Title string `json:"title"` Key string `json:"key"` Events []CalendarEvent `json:"events"` }
func GetCalendars ¶
type CalendarConfig ¶
type CalendarEntry ¶
type CalendarEvent ¶
type Config ¶
type Config struct { Global GlobalConfig `toml:"global"` HomeAssistant HomeAssistantConfig `toml:"home-assistant"` SchoolBus SchoolBusConfig `toml:"school-bus"` SchoolLunch SchoolLunchConfig `toml:"school-lunch"` Calendars []CalendarConfig `toml:"calendars"` Locks []LockConfig `toml:"locks"` Sun SunConfig `toml:"sun"` Weather WeatherConfig `toml:"weather"` Trash TrashConfig `toml:"trash"` Travel []TravelConfig `toml:"travel"` }
func ParseConfig ¶
type CurrentWeather ¶
type ForecastWeather ¶
type GlobalConfig ¶
type HomeAssistant ¶
type HomeAssistant struct {
// contains filtered or unexported fields
}
func NewHomeAssistant ¶
func NewHomeAssistant(config Config) HomeAssistant
func (HomeAssistant) CallService ¶
func (ha HomeAssistant) CallService(domain string, service string, payload interface{}) (err error)
func (HomeAssistant) GetCalendar ¶
func (ha HomeAssistant) GetCalendar(key string, start time.Time, end time.Time, entries interface{}) (err error)
Fetches a calendar by the provided key and decodes the array into the entries argument
func (HomeAssistant) GetState ¶
func (ha HomeAssistant) GetState(key string, state interface{}) (err error)
Fetches a state by the provided key and decodes it into the state argument
type HomeAssistantConfig ¶
type Lock ¶
type LockConfig ¶
type LockPayload ¶
type LockPayload struct {
EntityId string `json:"entity_id"`
}
type SchoolBusConfig ¶
type SchoolCafe ¶
type SchoolCafe struct {
// contains filtered or unexported fields
}
func NewSchoolCafe ¶
func NewSchoolCafe(config Config) SchoolCafe
func (SchoolCafe) GetMenuItems ¶
func (sc SchoolCafe) GetMenuItems(date time.Time, mealType string) (items map[string][]SchoolCafeItem, err error)
type SchoolCafeItem ¶
type SchoolCafeItem struct {
Description string `json:"MenuItemDescription"`
}
type SchoolLunchConfig ¶
type SchoolMenu ¶
type SchoolMenu struct {
Entrees []SchoolMenuItem `json:"entrees"`
}
func GetSchoolLunch ¶
func GetSchoolLunch(config Config, date time.Time) (menu SchoolMenu, err error)
type SchoolMenuItem ¶
type SchoolMenuItem struct {
Description string `json:"description"`
}
type Sun ¶
type SunState ¶
type SunState struct { State string Attributes struct { NextDawn time.Time `json:"next_dawn"` NextDusk time.Time `json:"next_dusk"` NextMidnight time.Time `json:"next_midnight"` NextNoon time.Time `json:"next_noon"` NextRising time.Time `json:"next_rising"` NextSetting time.Time `json:"next_setting"` Rising bool `json:"rising"` } }
type TrashConfig ¶
type TravelConfig ¶
type TravelConfig struct {
Key string `toml:"key"`
}
type TravelState ¶
type TravelTime ¶
func GetTravelTimes ¶
func GetTravelTimes(config Config) (travelTimes []TravelTime, err error)
type Weather ¶
type Weather struct { Current CurrentWeather `json:"current"` Forecast []ForecastWeather `json:"forecast"` }
func GetWeather ¶
type WeatherConfig ¶
type WeatherConfig struct {
Key string `toml:"key"`
}
Click to show internal directories.
Click to hide internal directories.