Use DeviceInfo in toon (#58605)

Co-authored-by: epenet <epenet@users.noreply.github.com>
This commit is contained in:
epenet 2021-10-28 18:20:41 +02:00 committed by GitHub
parent e64bc67bec
commit a0b3a58d1c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,15 +23,13 @@ class ToonDisplayDeviceEntity(ToonEntity):
def device_info(self) -> DeviceInfo: def device_info(self) -> DeviceInfo:
"""Return device information about this thermostat.""" """Return device information about this thermostat."""
agreement = self.coordinator.data.agreement agreement = self.coordinator.data.agreement
model = agreement.display_hardware_version.rpartition("/")[0] return DeviceInfo(
sw_version = agreement.display_software_version.rpartition("/")[-1] identifiers={(DOMAIN, agreement.agreement_id)},
return { manufacturer="Eneco",
"identifiers": {(DOMAIN, agreement.agreement_id)}, model=agreement.display_hardware_version.rpartition("/")[0],
"name": "Toon Display", name="Toon Display",
"manufacturer": "Eneco", sw_version=agreement.display_software_version.rpartition("/")[-1],
"model": model, )
"sw_version": sw_version,
}
class ToonElectricityMeterDeviceEntity(ToonEntity): class ToonElectricityMeterDeviceEntity(ToonEntity):