diff --git a/CHANGELOG.md b/CHANGELOG.md index b6e9b60..6fdeef1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 2.1.4 + +- Update supported interfaces, including interface type [#137](https://github.com/elad-bar/ha-edgeos/issues/137) + ## 2.1.3 - Update supported interfaces [#137](https://github.com/elad-bar/ha-edgeos/issues/137) diff --git a/custom_components/edgeos/data_processors/interface_processor.py b/custom_components/edgeos/data_processors/interface_processor.py index 56a17a1..a43f2ac 100644 --- a/custom_components/edgeos/data_processors/interface_processor.py +++ b/custom_components/edgeos/data_processors/interface_processor.py @@ -150,6 +150,8 @@ def _extract_interface( if data is not None: if interface is None: interface = EdgeOSInterfaceData(name, interface_type) + else: + interface.update_interface_type(interface_type) interface.description = data.get(INTERFACE_DATA_DESCRIPTION) interface.duplex = data.get(INTERFACE_DATA_DUPLEX) diff --git a/custom_components/edgeos/manifest.json b/custom_components/edgeos/manifest.json index 38a99dc..59ef62b 100644 --- a/custom_components/edgeos/manifest.json +++ b/custom_components/edgeos/manifest.json @@ -8,5 +8,5 @@ "iot_class": "local_polling", "issue_tracker": "https://github.com/elad-bar/ha-edgeos/issues", "requirements": ["aiohttp"], - "version": "2.1.3" + "version": "2.1.4" } diff --git a/custom_components/edgeos/models/edge_os_interface_data.py b/custom_components/edgeos/models/edge_os_interface_data.py index 30f8ce7..9bb0bfb 100644 --- a/custom_components/edgeos/models/edge_os_interface_data.py +++ b/custom_components/edgeos/models/edge_os_interface_data.py @@ -79,6 +79,14 @@ def __init__(self, name: str, interface_type: InterfaceTypes): def unique_id(self) -> str: return self.name + def update_interface_type(self, interface_type: InterfaceTypes): + if ( + self.interface_type == InterfaceTypes.DYNAMIC + and self.interface_type != interface_type + ): + self.interface_type = interface_type + self.is_supported = self._get_is_supported() + def to_dict(self): obj = { INTERFACE_DATA_NAME: self.name,