tomaae / homeassistant-mikrotik_router

Mikrotik router integration for Home Assistant
Apache License 2.0
281 stars 41 forks source link

[Question] in attriputes port is absent attribute Rate #309

Open Shaderz opened 9 months ago

Shaderz commented 9 months ago

hi, i have a problem in my home assistant after update microtik integration to v2.1.4

in attriputes port is apbasent attribute Rate (current rate link speed)

how me to restore a this attribute? i use this attribute in my info statistic.

tomaae commented 9 months ago

These? image

Shaderz commented 9 months ago

These? image

no, this

image

tomaae commented 9 months ago

ah, it should be possible to add that one.

Shaderz commented 8 months ago

ah, it should be possible to add that one.

how to do it?

tomaae commented 8 months ago

no, I mean addint it as additional value in next release

Shaderz commented 1 month ago

no, I mean addint it as additional value in next release

Hello, is there progress in solving the problem? ) i update hacs plugin to version 2.1.4 but no attribute Rate...

Shaderz commented 1 month ago

i checked soitces and find attributes to adding string with aatribute - rate

/homeassistant/custom_components/mikrotik_router/coordinator.py .................. if self.ds["interface"][uid]["type"] == "ether": if ( "sfp-shutdown-temperature" in vals and vals["sfp-shutdown-temperature"] != "" ): self.ds["interface"] = parse_api( data=self.ds["interface"], source=self.api.query( "/interface/ethernet", command="monitor", args={".id": vals[".id"], "once": True}, ), key_search="name", vals=[ {"name": "status", "default": "unknown"}, {"name": "auto-negotiation", "default": "unknown"}, {"name": "rate", "default": "unknown"}, {"name": "advertising", "default": "unknown"}, ...............

/homeassistant/custom_components/mikrotik_router/binary_sensor_types.py /homeassistant/custom_components/mikrotik_router/switch_types.py /homeassistant/custom_components/mikrotik_router/sensor_types.py

DEVICE_ATTRIBUTES_IFACE_ETHER = [ "status", "auto-negotiation", "rate", "full-duplex", "default-name", "poe-out", ]