Skip to content

Commit

Permalink
add example that uses new functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
jgstew committed Apr 1, 2024
1 parent f47d258 commit 5c0bda6
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions examples/dashboard_variable_get_value.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""
get dashboard variable value
requires `besapi` v3.2.6+
install with command `pip install -U besapi`
"""

import besapi


def main():
"""Execution starts here"""
print("main()")

bes_conn = besapi.besapi.get_bes_conn_using_config_file()
bes_conn.login()

print(bes_conn.last_connected)

print(bes_conn.get_dashboard_variable_value("WebUIAppAdmin", "Current_Sites"))

# dashboard_name = "PyBESAPITest"
# var_name = "TestVar"

# print(
# bes_conn.set_dashboard_variable_value(
# dashboard_name, var_name, "dashboard_variable_get_value.py 12345678"
# )
# )

# print(bes_conn.get_dashboard_variable_value(dashboard_name, var_name))

# print(bes_conn.delete(f"dashboardvariable/{dashboard_name}/{var_name}"))


if __name__ == "__main__":
main()

0 comments on commit 5c0bda6

Please sign in to comment.