Enhance OxiAPI and Node classes with type hints and property updates

- Updated the `OxiAPI` class to check for `None` explicitly when setting authentication credentials.
- Added type hints to the `Node` class and introduced a TODO for future enhancements.
- Refactored properties in the `NodeView` class to include type hints and improved handling of optional data retrieval.
This commit is contained in:
IluaAir
2026-03-18 00:15:09 +03:00
parent 1d0f5ed685
commit c216ee51ef
3 changed files with 19 additions and 13 deletions

View File

@@ -3,6 +3,7 @@ from requests import Session
from .node import Node
# TODO: Add custom adapter for Oxi
class OxiAPI:
def __init__(
self,
@@ -14,7 +15,7 @@ class OxiAPI:
self.base_url = url.rstrip("/")
self._session = Session()
self._session.verify = verify
if username and password:
if username is not None and password is not None:
self._session.auth = (username, password)
self.node = Node(self._session, self.base_url)