Refactor BaseDevice methods for improved data handling and validation

- Updated the `BaseDevice` class to replace `_raw` with `raw` for consistency in data access.
- Enhanced the `vlans`, `interfaces`, and `system` methods to utilize the new `raw` attribute.
- Introduced a `_validate_contract` method to streamline the validation of parsed data into structured models.
- Adjusted the `Keenetic` and `Mikrotik` models to align with the updated data handling approach, ensuring proper parsing and decoding of interface and VLAN data.
This commit is contained in:
IluaAir
2026-02-22 09:52:17 +03:00
parent 2394296f5b
commit 3635a07b27
4 changed files with 44 additions and 50 deletions

View File

@@ -30,7 +30,7 @@ class NodeConfig:
@property
def json(self):
return self._response.json()
return self._parsed_data.json()
def __str__(self):
return self.text