1 From a6bfd71a96201127836d59736abcb54dc2d5e1a5 Mon Sep 17 00:00:00 2001
2 From: Heinrich Schuchardt <xypron.glpk@gmx.de>
3 Date: Mon, 14 Sep 2020 12:50:56 +0200
4 Subject: [PATCH] cmd/button: return button status
6 To make the button command useful in a shell script it should return the
9 * 0 (true) - pressed, on
10 * 1 (false) - not pressed, off
12 The button command takes only one argument. Correct maxargs.
14 Adjust the Python unit test.
16 Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
17 Reviewed-by: Philippe Reynes <philippe.reynes@softathome.com>
20 test/py/tests/test_button.py | 34 ++++++++++++++++++++++++++--------
21 2 files changed, 28 insertions(+), 10 deletions(-)
25 @@ -75,11 +75,11 @@ int do_button(struct cmd_tbl *cmdtp, int
27 ret = show_button_state(dev);
34 - button, 4, 1, do_button,
35 + button, 2, 1, do_button,
37 "<button_label> \tGet button state\n"
38 "button list\t\tShow a list of buttons"