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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user