From e5bd2c16b674bd9fdea9b2b23fdad5a9e8589236 Mon Sep 17 00:00:00 2001 From: "coderabbitai[bot]" <136622811+coderabbitai[bot]@users.noreply.github.com> Date: Sat, 11 Jan 2025 18:41:00 +0000 Subject: [PATCH 1/3] =?UTF-8?q?=F0=9F=93=9D=20Add=20docstrings=20to=20`fea?= =?UTF-8?q?t/mk1`=20(#12)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Docstrings generation was requested by @JarbasAl. * https://github.com/OpenVoiceOS/ovos-i2c-detection/pull/10#issuecomment-2585364749 The following files were modified: * `ovos_i2c_detection/__init__.py` Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- ovos_i2c_detection/__init__.py | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/ovos_i2c_detection/__init__.py b/ovos_i2c_detection/__init__.py index ebbeed6..d3e0c7a 100644 --- a/ovos_i2c_detection/__init__.py +++ b/ovos_i2c_detection/__init__.py @@ -4,6 +4,19 @@ from ovos_utils.log import LOG def is_texas_tas5806(): + """ + Detect the presence of a Texas TAS5806 audio amplifier via I2C communication. + + Executes an I2C detection command to identify the Texas TAS5806 audio amplifier on bus 1 at address 0x2f. + + Returns: + bool: True if the TAS5806 amplifier is detected, False otherwise + + Notes: + - Uses i2cdetect command to probe the I2C bus + - Checks for device response with address "2f" or "UU" + - Requires i2c-tools to be installed + """ cmd = 'i2cdetect -y -a 1 0x2f 0x2f | egrep "(2f|UU)" | awk \'{print $2}\'' out = subprocess.check_output(cmd, shell=True).strip() if out == b"2f" or out == b"UU": @@ -57,6 +70,22 @@ def is_adafruit_amp(): return False def is_mark_1(): + """ + Detect the presence of a Mark 1 device via serial communication. + + Checks for the Mark 1 device by first verifying the presence of a WM8960 audio codec, + then attempting to establish a serial connection and retrieve system version information. + + Returns: + bool: True if a Mark 1 device is successfully detected, False otherwise + + Notes: + - Requires WM8960 audio codec to be present + - Uses serial communication on /dev/ttyAMA0 at 9600 baud + - Sends 'system.version' command to verify device + - Logs firmware version if successfully detected + - Handles potential serial communication errors gracefully + """ if is_wm8960(): try: ser = serial.Serial("/dev/ttyAMA0", 9600, timeout=5) From 49c08ea851a110466b766f7cf46a0b67610ca594 Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Sat, 11 Jan 2025 18:41:17 +0000 Subject: [PATCH 2/3] Increment Version to 0.0.6a1 --- ovos_i2c_detection/version.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ovos_i2c_detection/version.py b/ovos_i2c_detection/version.py index 820f295..df66784 100644 --- a/ovos_i2c_detection/version.py +++ b/ovos_i2c_detection/version.py @@ -1,6 +1,6 @@ # START_VERSION_BLOCK VERSION_MAJOR = 0 VERSION_MINOR = 0 -VERSION_BUILD = 5 -VERSION_ALPHA = 0 +VERSION_BUILD = 6 +VERSION_ALPHA = 1 # END_VERSION_BLOCK From a57bcd23d0efa9f1da7d8d8afad890f3ca0d8762 Mon Sep 17 00:00:00 2001 From: JarbasAl Date: Sat, 11 Jan 2025 18:41:34 +0000 Subject: [PATCH 3/3] Update Changelog --- CHANGELOG.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0564360..a5255a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,12 @@ # Changelog -## [0.0.5a2](https://github.com/OpenVoiceOS/ovos-i2c-detection/tree/0.0.5a2) (2025-01-11) +## [0.0.6a1](https://github.com/OpenVoiceOS/ovos-i2c-detection/tree/0.0.6a1) (2025-01-11) -[Full Changelog](https://github.com/OpenVoiceOS/ovos-i2c-detection/compare/0.0.4...0.0.5a2) +[Full Changelog](https://github.com/OpenVoiceOS/ovos-i2c-detection/compare/0.0.5...0.0.6a1) **Merged pull requests:** -- Feat/mk1 [\#10](https://github.com/OpenVoiceOS/ovos-i2c-detection/pull/10) ([builderjer](https://github.com/builderjer)) -- close serial port [\#8](https://github.com/OpenVoiceOS/ovos-i2c-detection/pull/8) ([builderjer](https://github.com/builderjer)) +- 📝 Add docstrings to `feat/mk1` [\#12](https://github.com/OpenVoiceOS/ovos-i2c-detection/pull/12) ([coderabbitai[bot]](https://github.com/apps/coderabbitai))