diff --git a/homeassistant/components/apsystems/coordinator.py b/homeassistant/components/apsystems/coordinator.py index e56cb826840..2535c66c4ac 100644 --- a/homeassistant/components/apsystems/coordinator.py +++ b/homeassistant/components/apsystems/coordinator.py @@ -29,6 +29,8 @@ class ApSystemsSensorData: class ApSystemsDataCoordinator(DataUpdateCoordinator[ApSystemsSensorData]): """Coordinator used for all sensors.""" + device_version: str + def __init__(self, hass: HomeAssistant, api: APsystemsEZ1M) -> None: """Initialize my coordinator.""" super().__init__( @@ -46,6 +48,7 @@ class ApSystemsDataCoordinator(DataUpdateCoordinator[ApSystemsSensorData]): raise UpdateFailed from None self.api.max_power = device_info.maxPower self.api.min_power = device_info.minPower + self.device_version = device_info.devVer async def _async_update_data(self) -> ApSystemsSensorData: try: diff --git a/homeassistant/components/apsystems/entity.py b/homeassistant/components/apsystems/entity.py index 519f4fffb61..7770b451680 100644 --- a/homeassistant/components/apsystems/entity.py +++ b/homeassistant/components/apsystems/entity.py @@ -21,7 +21,8 @@ class ApSystemsEntity(Entity): """Initialize the APsystems entity.""" self._attr_device_info = DeviceInfo( identifiers={(DOMAIN, data.device_id)}, - serial_number=data.device_id, manufacturer="APsystems", model="EZ1-M", + serial_number=data.device_id, + sw_version=data.coordinator.device_version.split(" ")[1], ) diff --git a/tests/components/apsystems/conftest.py b/tests/components/apsystems/conftest.py index 7a48ff7db3f..92af6885c0b 100644 --- a/tests/components/apsystems/conftest.py +++ b/tests/components/apsystems/conftest.py @@ -38,7 +38,7 @@ def mock_apsystems() -> Generator[MagicMock]: mock_api = mock_client.return_value mock_api.get_device_info.return_value = ReturnDeviceInfo( deviceId="MY_SERIAL_NUMBER", - devVer="1.0.0", + devVer="EZ1 1.0.0", ssid="MY_SSID", ipAddr="127.0.01", minPower=0,