From 4ee7b6c7f947d69f636077025bcd8cedb2680e48 Mon Sep 17 00:00:00 2001 From: karthikaeyetea Date: Thu, 10 Nov 2022 21:38:02 +0530 Subject: [PATCH] Added country data to set_radio_channel Signed-off-by: karthikaeyetea --- lf_libs/lf_libs.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lf_libs/lf_libs.py b/lf_libs/lf_libs.py index 8177c03b..52823c8c 100644 --- a/lf_libs/lf_libs.py +++ b/lf_libs/lf_libs.py @@ -932,7 +932,8 @@ class lf_libs: except Exception as e: logging.error(e) - def set_radio_channel(self, radio="1.1.wiphy0", channel="AUTO"): + def set_radio_channel(self, radio="1.1.wiphy0", channel="AUTO", country=None): + # country_code = US(840) try: radio = radio.split(".") shelf = radio[0] @@ -946,6 +947,11 @@ class lf_libs: "mode": "NA", "channel": channel } + try: + if country: # update the dictionary + data["country"] = country + except Exception as e: + logging.error(f"{e}\nunable to change lanforge radio country code") local_realm_obj.json_post("/cli-json/set_wifi_radio", _data=data) time.sleep(2) except Exception as e: