Skip to content

Commit

Permalink
UNIFI import plugin 0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
jokob-sk committed Apr 1, 2023
1 parent 310b6de commit c8fcf62
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion front/plugins/unifi_import/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Overview

A plugin allowing for importing devices from an UniFi controller.
A plugin allowing for importing devices from a UniFi controller.

### Usage

Expand Down
9 changes: 4 additions & 5 deletions front/plugins/unifi_import/script.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env python
# Based on the work of https://github.com/stevehoek/Pi.Alert
# Inspired by https://github.com/stevehoek/Pi.Alert

# Example call
# python3 /home/pi/pialert/front/plugins/unifi_import/script.py username=pialert password=passw0rd host=192.168.1.1 site=default protocol=https:// port=8443
Expand All @@ -19,7 +19,6 @@
from requests.packages.urllib3.exceptions import InsecureRequestWarning
import pwd
import os
from unificontrol import UnifiClient
from pyunifi.controller import Controller


Expand Down Expand Up @@ -110,7 +109,7 @@ def get_entries(newEntries):

tmpPlugObj = plugin_object_class(
ap['mac'],
ap['ip'],
get_unifi_val(ap, 'ip'),
name,
'Ubiquiti Networks Inc.',
deviceType,
Expand All @@ -134,7 +133,7 @@ def get_entries(newEntries):

tmpPlugObj = plugin_object_class(
cl['mac'],
cl['ip'],
get_unifi_val(cl, 'ip'),
name,
get_unifi_val(cl, 'oui'),
'Other',
Expand All @@ -156,7 +155,7 @@ def get_entries(newEntries):

tmpPlugObj = plugin_object_class(
us['mac'],
us['ip'],
get_unifi_val(us, 'ip'),
name,
get_unifi_val(us, 'oui'),
'Other',
Expand Down

0 comments on commit c8fcf62

Please sign in to comment.