diff --git a/waveshare2in13v2/waveshare213v2.go b/waveshare2in13v2/waveshare213v2.go index 5d1849e..4bc988a 100644 --- a/waveshare2in13v2/waveshare213v2.go +++ b/waveshare2in13v2/waveshare213v2.go @@ -281,7 +281,9 @@ func (d *Dev) Halt() error { // String returns a string containing configuration information. func (d *Dev) String() string { - return fmt.Sprintf("epd.Dev{%s, %s, Height: %d, Width: %d}", d.c, d.dc, d.opts.Height, d.opts.Width) + bounds := d.Bounds() + + return fmt.Sprintf("epd.Dev{%s, %s, Width: %d, Height: %d}", d.c, d.dc, bounds.Dx(), bounds.Dy()) } // Sleep makes the controller enter deep sleep mode. It can be woken up by diff --git a/waveshare2in13v2/waveshare213v2_test.go b/waveshare2in13v2/waveshare213v2_test.go index 54749c1..2a5782d 100644 --- a/waveshare2in13v2/waveshare213v2_test.go +++ b/waveshare2in13v2/waveshare213v2_test.go @@ -25,14 +25,14 @@ func TestNew(t *testing.T) { }{ { name: "empty", - wantString: "epd.Dev{playback, (0), Height: 0, Width: 0}", + wantString: "epd.Dev{playback, (0), Width: 0, Height: 0}", }, { name: "EPD2in13v2", opts: EPD2in13v2, wantBounds: image.Rect(0, 0, 122, 250), wantBufferBounds: image.Rect(0, 0, 128, 250), - wantString: "epd.Dev{playback, (0), Height: 250, Width: 122}", + wantString: "epd.Dev{playback, (0), Width: 122, Height: 250}", }, } { t.Run(tc.name, func(t *testing.T) {