Enhance Keenetic model and update templates for improved data handling

- Implemented the `interfaces` and `vlans` methods in the `Keenetic` model to process and decode interface and VLAN data.
- Added a `_decode_utf` method to handle UTF-8 encoded descriptions.
- Updated the Keenetic TTP template to define structured groups for system, interfaces, and VLANs.
- Refactored file paths in the `Mikrotik` model for consistency and clarity.
This commit is contained in:
IluaAir
2026-02-22 00:21:55 +03:00
parent a41cb1f7ec
commit 2394296f5b
5 changed files with 85 additions and 11 deletions

View File

@@ -1,3 +1,4 @@
import os
from oxi.interfaces import register_parser
from oxi.interfaces.base import BaseDevice
from oxi.interfaces.contract import Interfaces, System, Vlans
@@ -19,7 +20,8 @@ class Mikrotik(BaseDevice):
if __name__ == "__main__":
with open("../../test.txt") as file:
print(os.path.abspath(os.curdir))
with open("./test.txt") as file:
data = file.read()
mikr = Mikrotik(data)
print(mikr.parse().json())