Add ttp dependency and refactor OxiAPI and NodeConfig classes

- Added `ttp` as a dependency in `pyproject.toml` and `uv.lock`.
- Updated `NodeConfig` to store model names in lowercase.
- Refactored `OxiAPI` to always create a new session and added a `close` method.
- Removed unnecessary logging in `Node` class.
- Introduced interfaces for device registration with a new `BaseDevice` class and a `register_parser` function.
- Created initial structure for device models, including a `Mikrotik` parser.
This commit is contained in:
IluaAir
2026-02-14 21:31:02 +03:00
parent 8e85086d98
commit b60182ef3c
9 changed files with 57 additions and 19 deletions

View File

@@ -1,6 +1,6 @@
from typing import TYPE_CHECKING
from oxi.view import NodeView
from .view import NodeView
if TYPE_CHECKING:
@@ -19,9 +19,6 @@ class Node:
url += ".json"
response = self._session.get(url)
if response.status_code == 500:
log.warning(
"Oxidized response: %r , %r not found", response.status_code, url
)
raise ValueError(f"page {url} not found")
return NodeView(
session=self._session, base_url=self._base_url, data=response.json()