Skip to content

Commit 86a20c7

Browse files
committed
Converted rows/columns to read-only property
1 parent 0f4ede8 commit 86a20c7

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

adafruit_ht16k33/matrix.py

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,15 @@
2525
================
2626
2727
"""
28-
2928
from adafruit_ht16k33.ht16k33 import HT16K33
3029

3130
__version__ = "0.0.0-auto.0"
3231
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_HT16K33.git"
3332

3433
class Matrix8x8(HT16K33):
3534
"""A single matrix."""
36-
columns = 8
37-
rows = 8
35+
_columns = 8
36+
_rows = 8
3837

3938
def pixel(self, x, y, color=None):
4039
"""Get or set the color of a given pixel."""
@@ -109,10 +108,17 @@ def shift_down(self, rotate=False):
109108
if self._auto_write:
110109
self.show()
111110

111+
@property
112+
def columns(self):
113+
return self._columns
114+
115+
@property
116+
def rows(self):
117+
return self._rows
118+
112119
class Matrix16x8(Matrix8x8):
113120
"""The matrix wing."""
114-
columns = 16
115-
rows = 8
121+
_columns = 16
116122

117123
def pixel(self, x, y, color=None):
118124
"""Get or set the color of a given pixel."""

0 commit comments

Comments
 (0)