Skip to content

Commit

Permalink
depreciated detection
Browse files Browse the repository at this point in the history
  • Loading branch information
builderjer committed Jun 2, 2024
1 parent 7ca41cc commit 3873ec2
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions ovos_PHAL/detection.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,16 @@
from ovos_utils.log import deprecated


def is_mycroft_sj201_v6():
@deprecated("Use from ovos-i2c-detection import is_sj201_v6", "0.2.0")
def is_mycroft_sj201():
cmd = 'i2cdetect -y -a 1 0x04 0x04 | egrep "(04|UU)" | awk \'{print $2}\''
out = subprocess.check_output(cmd, shell=True).strip()
if out == b"04" or out == b"UU":
return True
return False


@deprecated("Use is_mycroft_sj201_v6", "0.2.0")
def is_mycroft_sj201():
return is_mycroft_sj201_v6()


@deprecated("Use from ovos-i2c-detection import is_wm8960", "0.2.0")
def is_respeaker_2mic():
cmd = 'i2cdetect -y -a 1 0x1a 0x1a | egrep "(1a|UU)" | awk \'{print $2}\''
out = subprocess.check_output(cmd, shell=True).strip()
Expand All @@ -23,6 +20,7 @@ def is_respeaker_2mic():
return False


@deprecated("Use from ovos-i2c-detection import is_respeaker_4mic", "0.2.0")
def is_respeaker_4mic():
cmd = 'i2cdetect -y -a 0x35 0x35 | egrep "(35|UU)" | awk \'{print $2}\''
out = subprocess.check_output(cmd, shell=True).strip()
Expand All @@ -31,6 +29,7 @@ def is_respeaker_4mic():
return False


@deprecated("Use from ovos-i2c-detection import is_respeaker_6mic", "0.2.0")
def is_respeaker_6mic():
cmd = 'i2cdetect -y -a 0x3b 0x3b | egrep "(3b|UU)" | awk \'{print $2}\''
out = subprocess.check_output(cmd, shell=True).strip()
Expand All @@ -39,6 +38,7 @@ def is_respeaker_6mic():
return False


@deprecated("Use from ovos-i2c-detection import is_adafruit_amp", "0.2.0")
def is_adafruit():
cmd = 'i2cdetect -y -a 0x4b 0x4b | egrep "(4b|UU)" | awk \'{print $2}\''
out = subprocess.check_output(cmd, shell=True).strip()
Expand All @@ -47,15 +47,10 @@ def is_adafruit():
return False


@deprecated("Use from ovos-i2c-detection import is_tas5806", "0.2.0")
def is_texas_tas5806():
cmd = 'i2cdetect -y -a 0x2f 0x2f | egrep "(2f|UU)" | awk \'{print $2}\''
out = subprocess.check_output(cmd, shell=True).strip()
if out == b"2f" or out == b"UU":
return True
return False


def is_mycroft_sj201_v10():
if is_texas_tas5806 and not is_mycroft_sj201_v6:
return True
return False

0 comments on commit 3873ec2

Please sign in to comment.