From 1876e2dfd8a7f9a1d116e8d0dc898897358ae393 Mon Sep 17 00:00:00 2001 From: Eden Refael Date: Fri, 29 Nov 2024 11:57:57 +0200 Subject: [PATCH] created the amixer parser docu --- jc/parsers/amixer.py | 56 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/jc/parsers/amixer.py b/jc/parsers/amixer.py index 06519cc0..3df23781 100644 --- a/jc/parsers/amixer.py +++ b/jc/parsers/amixer.py @@ -1,3 +1,59 @@ +r"""jc - JSON Convert `amixer sget` command output parser +Usage (cli): + $ amixer sget | jc --amixer + $ amixer sget Master | jc --amixer + $ amixer sget Capture | jc --amixer + $ amixer sget Speakers | jc --amixer +Usage (module): + import jc + result = jc.parse('amixer', ) +Schema: +{ + "control_name": string, + "capabilities": [ + string + ], + "playback_channels": [ + string + ], + "limits": { + "playback_min": string, + "playback_max": string + }, + "mono": { + "playback_value": string, + "percentage": string, + "dB": string, + "status": string + } +} + +Examples: +$ amixer sget Master | jc --amixer -p +{ + "control_name": "Master", + "capabilities": [ + "pvolume", + "pvolume-joined", + "pswitch", + "pswitch-joined" + ], + "playback_channels": [ + "Mono" + ], + "limits": { + "playback_min": "0", + "playback_max": "87" + }, + "mono": { + "playback_value": "87", + "percentage": "100%", + "dB": "0.00dB", + "status": "on" + } +} + +""" from typing import List, Dict import jc.utils