Merge pull request #145 from martimarkov/patch-1

Add measurement to TrafficSensor
This commit is contained in:
Tomaae 2021-11-08 03:14:43 +01:00 committed by GitHub
commit 4af67f849e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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]: