Documentation ¶
Index ¶
- Constants
- func NewErrorRenderer(template core.Template, err error) core.Renderer
- func NewResponseRenderer(template core.Template, nodeId string, itemRenderer []core.Renderer) core.Renderer
- func NewTimestampRenderer(template core.Template) core.Renderer
- type BillingReportRenderer
- type DisplayConfig
- type ErrorRenderer
- type IndoorClimateRenderer
- type ResponseRenderer
- type TimestampRenderer
- type WeatherIconMap
- type WeatherRenderer
Constants ¶
const ( COLOR_WHITE textColor = "WHITE" COLOR_BLACK textColor = "BLACK" COLOR_RED textColor = "RED" )
const ( BATTERY_LEVEL_4_4 batteryLevelIcon = "\uf240" BATTERY_LEVEL_3_4 batteryLevelIcon = "\uf241" BATTERY_LEVEL_2_4 batteryLevelIcon = "\uf242" BATTERY_LEVEL_1_4 batteryLevelIcon = "\uf243" BATTERY_LEVEL_0_4 batteryLevelIcon = "\uf244" )
Variables ¶
This section is empty.
Functions ¶
func NewErrorRenderer ¶
NewErrorRenderertemplate returns a renderer which generates items for passed error message.
Types ¶
type BillingReportRenderer ¶ added in v1.2.0
type BillingReportRenderer struct {
// contains filtered or unexported fields
}
func NewBillingReportRenderer ¶ added in v1.2.0
func NewBillingReportRenderer(conf config.Config, logger log.Logger, template core.Template, datasource core.DataSource) *BillingReportRenderer
NewBillingReportRenderer returns a renderer which generates items for AWS billing reports.
func (*BillingReportRenderer) Content ¶ added in v1.2.0
func (renderer *BillingReportRenderer) Content() (string, error)
Content generates items for billing reports received from used datasource.
func (*BillingReportRenderer) ObserveDataSource ¶ added in v1.2.0
func (renderer *BillingReportRenderer) ObserveDataSource(ctx context.Context)
ObserveDataSource will listen for new billing reports and exchange rate events, if report and display currency differs.
type DisplayConfig ¶
type DisplayConfig struct {
// contains filtered or unexported fields
}
func NewDisplayConfig ¶
func NewDisplayConfig(conf config.Config) *DisplayConfig
NewDisplayConfig extracts list of display ids from passed config and returns a DisplayCondig which can be used to ensure valid display ids.
func (*DisplayConfig) All ¶
func (cfg *DisplayConfig) All() []string
All returns the list of all available display ids.
func (*DisplayConfig) Exists ¶
func (cfg *DisplayConfig) Exists(displayId string) bool
Exists returns true if passed display id is available in internal display list.
type ErrorRenderer ¶
type ErrorRenderer struct {
// contains filtered or unexported fields
}
func (*ErrorRenderer) Content ¶
func (renderer *ErrorRenderer) Content() (string, error)
Content returns errpr message passed at initialization as items. Together with a title and a timestamp.
type IndoorClimateRenderer ¶ added in v1.1.0
type IndoorClimateRenderer struct {
// contains filtered or unexported fields
}
func NewIndoorClimateRenderer ¶
func NewIndoorClimateRenderer(conf config.Config, logger log.Logger, template core.Template, datasource core.DataSource) *IndoorClimateRenderer
NewIndoorClimateRenderer returns a new renderer for infoor climate data. Room will be taken from passed config, template and datasource have to be passed.
func (*IndoorClimateRenderer) Content ¶ added in v1.1.0
func (renderer *IndoorClimateRenderer) Content() (string, error)
Content fetches current inddor climate data and generated room climate elements based pn given room/device config.
func (*IndoorClimateRenderer) ObserveDataSource ¶ added in v1.1.0
func (renderer *IndoorClimateRenderer) ObserveDataSource(ctx context.Context)
ObserveDataSource will listen for new indoor climate data provided by used datasource.
type ResponseRenderer ¶
type ResponseRenderer struct {
// contains filtered or unexported fields
}
func (*ResponseRenderer) Content ¶
func (renderer *ResponseRenderer) Content() (string, error)
Content returns the main layout for eInk display which includes renderer/node id and all passed items.
type TimestampRenderer ¶ added in v1.1.0
type TimestampRenderer struct {
// contains filtered or unexported fields
}
func (*TimestampRenderer) Content ¶ added in v1.1.0
func (renderer *TimestampRenderer) Content() (string, error)
Content generates a single item with a current timestamp.
type WeatherIconMap ¶ added in v1.2.5
type WeatherIconMap struct {
// contains filtered or unexported fields
}
type WeatherRenderer ¶ added in v1.2.5
type WeatherRenderer struct {
// contains filtered or unexported fields
}
func NewWeatherRenderer ¶ added in v1.2.9
func NewWeatherRenderer(conf config.Config, logger log.Logger, currentWeatherTemplate core.Template, forecastTemplate core.Template, datasource core.DataSource) *WeatherRenderer
NewWeatherRenderer returns a renderer which generates items for current weather and forcast.
func (*WeatherRenderer) Content ¶ added in v1.2.9
func (renderer *WeatherRenderer) Content() (string, error)
Content generates items for weather data.
func (*WeatherRenderer) ObserveDataSource ¶ added in v1.2.9
func (renderer *WeatherRenderer) ObserveDataSource(ctx context.Context)
ObserveDataSource will listen for new billing reports and exchange rate events, if report and display currency differs.