Replaced device_state_attributes for extra_state_attributes, fixes #152

This commit is contained in:
tomaae 2021-12-13 10:59:36 +01:00
parent 572ce4eebe
commit e10ab3e0ee
4 changed files with 10 additions and 10 deletions

View file

@ -246,7 +246,7 @@ class MikrotikControllerBinarySensor(BinarySensorEntity):
return f"{self._inst} {self._type[ATTR_LABEL]}" return f"{self._inst} {self._type[ATTR_LABEL]}"
@property @property
def device_state_attributes(self) -> Dict[str, Any]: def extra_state_attributes(self) -> Dict[str, Any]:
"""Return the state attributes.""" """Return the state attributes."""
return self._attrs return self._attrs
@ -356,7 +356,7 @@ class MikrotikControllerPPPSecretBinarySensor(MikrotikControllerBinarySensor):
return "mdi:account-off-outline" return "mdi:account-off-outline"
@property @property
def device_state_attributes(self) -> Dict[str, Any]: def extra_state_attributes(self) -> Dict[str, Any]:
"""Return the state attributes.""" """Return the state attributes."""
attributes = self._attrs attributes = self._attrs
for variable in DEVICE_ATTRIBUTES_PPP_SECRET: for variable in DEVICE_ATTRIBUTES_PPP_SECRET:
@ -450,7 +450,7 @@ class MikrotikControllerPortBinarySensor(MikrotikControllerBinarySensor):
return icon return icon
@property @property
def device_state_attributes(self) -> Dict[str, Any]: def extra_state_attributes(self) -> Dict[str, Any]:
"""Return the state attributes.""" """Return the state attributes."""
attributes = self._attrs attributes = self._attrs
for variable in DEVICE_ATTRIBUTES_IFACE: for variable in DEVICE_ATTRIBUTES_IFACE:

View file

@ -225,7 +225,7 @@ class MikrotikControllerDeviceTracker(ScannerEntity):
return info return info
@property @property
def device_state_attributes(self) -> Dict[str, Any]: def extra_state_attributes(self) -> Dict[str, Any]:
"""Return the state attributes.""" """Return the state attributes."""
attributes = self._attrs attributes = self._attrs
return attributes return attributes
@ -301,7 +301,7 @@ class MikrotikControllerHostDeviceTracker(MikrotikControllerDeviceTracker):
return "mdi:lan-disconnect" return "mdi:lan-disconnect"
@property @property
def device_state_attributes(self) -> Dict[str, Any]: def extra_state_attributes(self) -> Dict[str, Any]:
"""Return the state attributes.""" """Return the state attributes."""
attributes = self._attrs attributes = self._attrs
for variable in DEVICE_ATTRIBUTES_HOST: for variable in DEVICE_ATTRIBUTES_HOST:

View file

@ -389,7 +389,7 @@ class MikrotikControllerSensor(SensorEntity):
return val return val
@property @property
def device_state_attributes(self) -> Dict[str, Any]: def extra_state_attributes(self) -> Dict[str, Any]:
"""Return the state attributes.""" """Return the state attributes."""
return self._attrs return self._attrs
@ -546,7 +546,7 @@ class MikrotikAccountingSensor(MikrotikControllerSensor):
return info return info
@property @property
def device_state_attributes(self) -> Dict[str, Any]: def extra_state_attributes(self) -> Dict[str, Any]:
"""Return the state attributes.""" """Return the state attributes."""
attributes = self._attrs attributes = self._attrs
for variable in DEVICE_ATTRIBUTES_ACCOUNTING: for variable in DEVICE_ATTRIBUTES_ACCOUNTING:

View file

@ -308,7 +308,7 @@ class MikrotikControllerSwitch(SwitchEntity, RestoreEntity):
return self._data["enabled"] return self._data["enabled"]
@property @property
def device_state_attributes(self) -> Dict[str, Any]: def extra_state_attributes(self) -> Dict[str, Any]:
"""Return the state attributes.""" """Return the state attributes."""
attributes = self._attrs attributes = self._attrs
@ -348,7 +348,7 @@ class MikrotikControllerPortSwitch(MikrotikControllerSwitch):
return f"{self._inst.lower()}-enable_switch-{self._data['port-mac-address']}_{self._data['default-name']}" return f"{self._inst.lower()}-enable_switch-{self._data['port-mac-address']}_{self._data['default-name']}"
@property @property
def device_state_attributes(self) -> Dict[str, Any]: def extra_state_attributes(self) -> Dict[str, Any]:
"""Return the state attributes.""" """Return the state attributes."""
attributes = self._attrs attributes = self._attrs