Use DeviceInfo in toon ()

Co-authored-by: epenet <epenet@users.noreply.github.com>
pull/58602/head^2
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
1 changed files with 7 additions and 9 deletions
homeassistant/components/toon

View File

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