func (b *Battery) Print() (blocks.Output, error) {
	t := template.New("b")
	t, err := t.Parse(b.Conf.PrintTemplate)
	if err != nil {
		return blocks.Output{}, errors.Wrap(err, "parsing template failed")
	}

	var out bytes.Buffer
	err = t.Execute(&out, b.Data)

	return blocks.Output{
			ShortText: out.String(),
			FullText:  out.String(),
			Urgent:    b.Data.Power <= b.Conf.UrgentValue,
			Color:     b.Conf.Color,
		},
		errors.Wrap(err, "executing template failed")
}
// Print outputs a formatted string using PrintTemplate
Print outputs a formatted string using PrintTemplate
// Print outputs a formatted string using PrintTemplate
func (b *Battery) Print() (blocks.Output, error) {
	t := template.New("b")
	t, err := t.Parse(b.Conf.PrintTemplate)
	if err != nil {
		return blocks.Output{}, errors.Wrap(err, "parsing template failed")
	}
	var out bytes.Buffer
	err = t.Execute(&out, b.Data)
	return blocks.Output{
			ShortText: out.String(),
			FullText:  out.String(),
			Urgent:    b.Data.Power <= b.Conf.UrgentValue,
			Color:     b.Conf.Color,
		},
		errors.Wrap(err, "executing template failed")
}
func ( b * Battery ) Print ( ) ( blocks . Output , error ) { t := template . New ( " " ) t , err := t . Parse ( b . Conf . PrintTemplate ) if err != nil { return blocks . Output { } , errors . Wrap ( err , " " ) } var out bytes . Buffer err = t . Execute ( & out , b . Data ) return blocks . Output { ShortText : out . String ( ) , FullText : out . String ( ) , Urgent : b . Data . Power <= b . Conf . UrgentValue , Color : b . Conf . Color , } , errors . Wrap ( err , " " ) }
Print outputs a formatted string using PrintTemplate
Print outputs a formatted string using PrintTemplate