SYNC required + docs

This commit is contained in:
jokob-sk
2024-10-10 07:55:37 +11:00
parent 48effdbbad
commit 222a439212
8 changed files with 24 additions and 14 deletions

View File

@@ -28,6 +28,7 @@ Device-detecting plugins insert values into the `CurrentScan` database table. T
|---------------|---------|--------------------------------------------|----------|----------|--------------------|---------------------------------------------------------------|
| `APPRISE` | ▶️ | Apprise notification proxy | | | Script | [_publisher_apprise](/front/plugins/_publisher_apprise/) |
| `ARPSCAN` | 🔍 | ARP-scan on current network | | | Script | [arp_scan](/front/plugins/arp_scan/) |
| `AVAHISCAN` | ♻ | Avahi (mDNS-based) name resolution | | | Script | [avahi_scan](/front/plugins/avahi_scan/) |
| `CSVBCKP` | ⚙ | CSV devices backup | | | Script | [csv_backup](/front/plugins/csv_backup/) |
| `DBCLNP` | ⚙ | Database cleanup | | Yes* | Script | [db_cleanup](/front/plugins/db_cleanup/) |
| `DDNS` | ⚙ | DDNS update | | | Script | [ddns_update](/front/plugins/ddns_update/) |
@@ -70,13 +71,13 @@ Device-detecting plugins insert values into the `CurrentScan` database table. T
## Plugin types
| Plugin type | Icon | Description | When to run | Required | Data source [?](/docs/PLUGINS_DEV.md) |
|---------------|------|---------------------------------------------------------------|--------------------------|----|---------|
| publisher | ▶️ | Sending notifications to services. | `on_notification` | ✖ | Script |
| dev scanner | 🔍 | Create devices in the app, usually scanning the current network. | `schedule` | ✖ | Script / SQLite DB |
| importer | 📥 | Importing devices from another service. | `schedule` | ✖ | Script / SQLite DB |
| system | ⚙ | Providing core system functionality. | `schedule` / always on | ✖/✔ | Script / Template |
| other | ♻ | Other scanners, e.g. for name resolution | misc | ✖ | Script / Template |
| Plugin type | Icon | Description | When to run | Required | Data source [?](/docs/PLUGINS_DEV.md) |
|---------------|------|----------------------------------------------------------------|--------------------------|----|---------|
| publisher | ▶️ | Sending notifications to services. | `on_notification` | ✖ | Script |
| dev scanner | 🔍 | Create devices in the app, manages online/offline device status. | `schedule` | ✖ | Script / SQLite DB |
| importer | 📥 | Importing devices from another service. | `schedule` | ✖ | Script / SQLite DB |
| system | ⚙ | Providing core system functionality. | `schedule` / always on | ✖/✔ | Script / Template |
| other | ♻ | Other scanners, e.g. for name resolution | misc | ✖ | Script / Template |
## Features

View File

@@ -23,11 +23,15 @@ Filters will be ignored, and this will delete all objects associated with the pl
![image](./Deleting_MQTT_Plugin_Objects.png)
This is not the case for the online/offline state of the device, which is always updated absed on the scan result and if it changed from the previous value.
Please note the online/offline state of the device is always updated based on the scan result and if it changed from the previous value.
# Sample Payloads
>[!WARNING]
> Please check your Home Assistant MQTT broker debug info for the most up-to-date data and format as the below might be outdated.
## Overview device
The below payloads apply to the device showing overall online/down/archived stats. You can toggle them on/off with the `SEND_STATS` setting.
@@ -197,8 +201,6 @@ Payload:
}
```
>[!WARNING]
> Please check your Home Assistant MQTT broker debug info for the most up-to-date data nad format as the above might be outdated.
## Implementation Notes

View File

@@ -8,3 +8,5 @@ You need Telegram bot to send notifications
### Usage
- Go to settings and fill in relevant details.
Made by [@doctorixx](https://github.com/doctorixx) 🙏

View File

@@ -46,9 +46,10 @@
]
},
"default_value": "disabled",
"default_value": "unused",
"options": [
"disabled",
"unused",
"once",
"schedule",
"always_after_scan",

View File

@@ -25,6 +25,8 @@ CUR_PATH = str(pathlib.Path(__file__).parent.resolve())
LOG_FILE = os.path.join(CUR_PATH, 'script.log')
RESULT_FILE = os.path.join(CUR_PATH, 'last_result.log')
pluginName = 'UNDIS'
def main():
# the script expects a parameter in the format of devices=device1,device2,...
@@ -32,7 +34,7 @@ def main():
parser.add_argument('devices', action="store", help="list of device names separated by ','")
values = parser.parse_args()
mylog('verbose', ['[UNDIS] In script'])
mylog('verbose', [f'[{pluginName}] In script'])
plugin_objects = Plugin_Objects( RESULT_FILE )