Skip to content

Commit

Permalink
Address API change request
Browse files Browse the repository at this point in the history
Changed property name from state to is_awake
Made self._is_awake private
  • Loading branch information
SAK917 committed Feb 4, 2021
1 parent 66d21f2 commit 7f3a7b2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions adafruit_displayio_sh1107.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,16 @@ def __init__(self, bus, **kwargs):
# set page address = 0xB0 - 0xBF (16 pages)
SH1107_addressing=True,
)
self.is_awake = True # Display starts in active state (_INIT_SEQUENCE)
self._is_awake = True # Display starts in active state (_INIT_SEQUENCE)

@property
def state(self):
def is_awake(self):
"""
The power state of the display. (read-only)
True if the display is active, False if in sleep mode.
"""
return self.is_awake
return self._is_awake

def sleep(self):
"""
Expand All @@ -94,14 +94,14 @@ def sleep(self):
3) Remembers display data and operation mode active prior to sleeping
4) The MP can access (update) the built-in display RAM
"""
if self.is_awake:
if self._is_awake:
self.bus.send(int(0xAE), "") # 0xAE = display off, sleep mode
self.is_awake = False
self._is_awake = False

def wake(self):
"""
Wake display from sleep mode
"""
if not self.is_awake:
if not self._is_awake:
self.bus.send(int(0xAF), "") # 0xAF = display on
self.is_awake = True
self._is_awake = True

0 comments on commit 7f3a7b2

Please sign in to comment.