Skip to content

Commit

Permalink
Fix #34 - Fixed interface parameter - connected (l1up vs. up)
Browse files Browse the repository at this point in the history
  • Loading branch information
elad-bar committed Oct 24, 2020
1 parent 9099a46 commit b957408
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 2020-10-24

**Fixed bugs:**

- Fixed interface parameter that should indicate whether an interface connected or not (l1up vs. up) [\#34](https://github.com/elad-bar/ha-edgeos/pull/34)


## 2020-09-17

**Fixed bugs:**
Expand Down
6 changes: 4 additions & 2 deletions custom_components/edgeos/helpers/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@
TRUE_STR = "true"
FALSE_STR = "false"

LINK_UP = "up"
LINK_ENABLED = "up"
LINK_CONNECTED = "l1up"

INTERFACES_STATS = "stats"

Expand Down Expand Up @@ -170,7 +171,8 @@
SERVICE_SET_LEVEL = "set_level"

INTERFACES_MAIN_MAP = {
LINK_UP: {ATTR_NAME: "Connected", ATTR_UNIT_OF_MEASUREMENT: "Connectivity"},
LINK_CONNECTED: {ATTR_NAME: "Connected", ATTR_UNIT_OF_MEASUREMENT: "Connectivity"},
LINK_ENABLED: {ATTR_NAME: "Enabled"},
"speed": {ATTR_NAME: "Link Speed (Mbps)"},
"duplex": {ATTR_NAME: "Duplex"},
"mac": {ATTR_NAME: "MAC"},
Expand Down
2 changes: 1 addition & 1 deletion custom_components/edgeos/managers/entity_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ def create_interface_binary_sensor(self, key, data):
data,
self.config_data.monitored_interfaces,
SENSOR_TYPE_INTERFACE,
LINK_UP,
LINK_CONNECTED,
self.get_interface_attributes,
)

Expand Down

0 comments on commit b957408

Please sign in to comment.