mirror of
https://github.com/tomaae/homeassistant-mikrotik_router.git
synced 2025-07-10 09:24:31 +02:00
Add measurement to TrafficSensor
Enables the usage of TrafficSensor within the statistics card
This commit is contained in:
parent
3e4223c525
commit
526b29ca67
1 changed files with 5 additions and 0 deletions
|
@ -478,6 +478,11 @@ class MikrotikControllerTrafficSensor(MikrotikControllerSensor):
|
|||
def unique_id(self) -> str:
|
||||
"""Return a unique id for this entity."""
|
||||
return f"{self._inst.lower()}-{self._sensor.lower()}-{self._data['default-name'].lower()}"
|
||||
|
||||
@property
|
||||
def state_class(self) -> str:
|
||||
"""Return the state_class"""
|
||||
return f"measurement"
|
||||
|
||||
@property
|
||||
def device_info(self) -> Dict[str, Any]:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue