Skip to content

Commit

Permalink
Update TEA5767.py
Browse files Browse the repository at this point in the history
  • Loading branch information
alankrantas authored May 1, 2020
1 parent 65813d6 commit 7cd7a91
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions TEA5767.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,17 +62,17 @@ def change_freqency(self, change):
self.search_direction = 1 if change >= 0 else 0
self.update()

def search(self, mode=True, dir=1, adc=7):
def search(self, mode, dir=1, adc=7):
self.search_mode = mode
self.search_direction = dir
self.search_adc_level = adc if adc in (10, 7, 5, 0) else 7
self.update()

def mute(self, mode=True):
def mute(self, mode):
self.mute_mode = mode
self.update()

def standby(self, mode=True):
def standby(self, mode):
self.standby_mode = mode
self.update()

Expand All @@ -84,7 +84,7 @@ def read(self):
self.is_stereo = int(buf[2]) >> 7 == 1
self.signal_adc_level = int(buf[3]) >> 4

def update(self, read=False):
def update(self):
buf = bytearray(5)
cmd = ''
if self.band_limits == 'US':
Expand Down Expand Up @@ -128,5 +128,4 @@ def update(self, read=False):
buf[3] = int(cmd, 2)
buf[4] = 0
self._i2c.writeto(self._address, buf)
if read:
self.read()
self.read()

0 comments on commit 7cd7a91

Please sign in to comment.