UNIFIAPI v0.5, css fixes
Some checks failed
Code checks / check-url-paths (push) Has been cancelled
docker / docker_dev (push) Has been cancelled
Deploy MkDocs / deploy (push) Has been cancelled

This commit is contained in:
jokob-sk
2025-08-13 06:48:36 +10:00
parent beaf8131ae
commit cbe71cc203
4 changed files with 29 additions and 17 deletions

View File

@@ -9,11 +9,10 @@ Unifi import plugin using the Site Manager API.
Navigate to your UniFi Site Manager _Settings -> Control Plane -> Integrations_.
- `api_key` : You can generate your API key under the _Your API Keys_ section.
- `base_url` : You can find your base url in the _API Request Format_ section, e.g. `https://192.168.100.1/proxy/network/integration/`
- `version` : You can find your version as part of the url in the _API Request Format_ section, e.g. `v1`
- `skip_ssl` : To skip SSL with you don't have an SSL certificate
- `UNIFIAPI_api_key` : You can generate your API key under the _Your API Keys_ section.
- `UNIFIAPI_base_url` : You can find your base url in the _API Request Format_ section, e.g. `https://192.168.100.1/proxy/network/integration/`
- `UNIFIAPI_api_version` : You can find your version as part of the url in the _API Request Format_ section, e.g. `v1`
- `UNIFIAPI_verify_ssl` : To skip SSL with you don't have an SSL certificate
### Usage

View File

@@ -241,7 +241,7 @@
{
"popupForm": [
{
"function": "name",
"function": "UNIFIAPI_site_name",
"type": {
"dataType": "string",
"elements": [
@@ -279,7 +279,7 @@
]
},
{
"function": "base_url",
"function": "UNIFIAPI_base_url",
"type": {
"dataType": "string",
"elements": [
@@ -317,7 +317,7 @@
]
},
{
"function": "api_version",
"function": "UNIFIAPI_api_version",
"type": {
"dataType": "string",
"elements": [
@@ -355,7 +355,7 @@
]
},
{
"function": "api_key",
"function": "UNIFIAPI_api_key",
"type": {
"dataType": "string",
"elements": [
@@ -393,7 +393,7 @@
]
},
{
"function": "verify_ssl",
"function": "UNIFIAPI_verify_ssl",
"type": {
"dataType": "boolean",
"elements": [

View File

@@ -38,7 +38,6 @@ RESULT_FILE = os.path.join(LOG_PATH, f'last_result.{pluginName}.log')
plugin_objects = Plugin_Objects(RESULT_FILE)
def main():
mylog('verbose', [f'[{pluginName}] In script'])
@@ -46,20 +45,19 @@ def main():
unifi_sites_configs = get_setting_value('UNIFIAPI_sites')
mylog('verbose', [f'[{pluginName}] number of unifi_sites_configs: {len(unifi_sites_configs)}'])
for site_config in unifi_sites_configs:
siteDict = decode_settings_base64(site_config)
mylog('verbose', [f'[{pluginName}] siteDict: {json.dumps(siteDict)}'])
mylog('none', [f'[{pluginName}] Connecting to: {siteDict["name"]}'])
mylog('none', [f'[{pluginName}] Connecting to: {siteDict["UNIFIAPI_site_name"]}'])
api = SiteManagerAPI(
api_key=siteDict["api_key"],
version=siteDict["api_version"],
base_url=siteDict["base_url"],
verify_ssl=siteDict["verify_ssl"]
api_key=siteDict["UNIFIAPI_api_key"],
version=siteDict["UNIFIAPI_api_version"],
base_url=siteDict["UNIFIAPI_base_url"],
verify_ssl=siteDict["UNIFIAPI_verify_ssl"]
)
sites_resp = api.get_sites()