mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-06-28 19:50:06 +02:00
Added SFP support #94
This commit is contained in:
parent
813455cc81
commit
3bf4c56254
4 changed files with 144 additions and 17 deletions
|
@ -58,6 +58,29 @@ DEVICE_ATTRIBUTES_IFACE = [
|
|||
"poe-out",
|
||||
]
|
||||
|
||||
DEVICE_ATTRIBUTES_IFACE_SFP = [
|
||||
"status",
|
||||
"auto-negotiation",
|
||||
"advertising",
|
||||
"link-partner-advertising",
|
||||
"sfp-temperature",
|
||||
"sfp-supply-voltage",
|
||||
"sfp-module-present",
|
||||
"sfp-tx-bias-current",
|
||||
"sfp-tx-power",
|
||||
"sfp-rx-power",
|
||||
"sfp-rx-loss",
|
||||
"sfp-tx-fault",
|
||||
"sfp-type",
|
||||
"sfp-connector-type",
|
||||
"sfp-vendor-name",
|
||||
"sfp-vendor-part-number",
|
||||
"sfp-vendor-revision",
|
||||
"sfp-vendor-serial",
|
||||
"sfp-manufacturing-date",
|
||||
"eeprom-checksum",
|
||||
]
|
||||
|
||||
DEVICE_ATTRIBUTES_PPP_SECRET = [
|
||||
"connected",
|
||||
"service",
|
||||
|
@ -430,6 +453,11 @@ class MikrotikControllerPortBinarySensor(MikrotikControllerBinarySensor):
|
|||
if variable in self._data:
|
||||
attributes[format_attribute(variable)] = self._data[variable]
|
||||
|
||||
if "sfp-shutdown-temperature" in self._data:
|
||||
for variable in DEVICE_ATTRIBUTES_IFACE_SFP:
|
||||
if variable in self._data:
|
||||
attributes[format_attribute(variable)] = self._data[variable]
|
||||
|
||||
return attributes
|
||||
|
||||
@property
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue