Add current and latest firmware info to Synology_dsm (#56460)
This commit is contained in:
parent
58f465f271
commit
b612e16120
1 changed files with 9 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
"""Support for Synology DSM binary sensors."""
|
"""Support for Synology DSM binary sensors."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from collections.abc import Mapping
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import BinarySensorEntity
|
from homeassistant.components.binary_sensor import BinarySensorEntity
|
||||||
|
@ -129,3 +130,11 @@ class SynoDSMUpgradeBinarySensor(SynoDSMBinarySensor):
|
||||||
def available(self) -> bool:
|
def available(self) -> bool:
|
||||||
"""Return True if entity is available."""
|
"""Return True if entity is available."""
|
||||||
return bool(self._api.upgrade)
|
return bool(self._api.upgrade)
|
||||||
|
|
||||||
|
@property
|
||||||
|
def extra_state_attributes(self) -> Mapping[str, Any] | None:
|
||||||
|
"""Return firmware details."""
|
||||||
|
return {
|
||||||
|
"installed_version": self._api.information.version_string,
|
||||||
|
"latest_available_version": self._api.upgrade.available_version,
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue