Allow different manufacturer than Amazon in Amazon Devices (#146333)

This commit is contained in:
tronikos 2025-06-08 11:47:46 -07:00 committed by GitHub
parent 560eeac457
commit f1244c182a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -25,15 +25,15 @@ class AmazonEntity(CoordinatorEntity[AmazonDevicesCoordinator]):
"""Initialize the entity.""" """Initialize the entity."""
super().__init__(coordinator) super().__init__(coordinator)
self._serial_num = serial_num self._serial_num = serial_num
model_details = coordinator.api.get_model_details(self.device) model_details = coordinator.api.get_model_details(self.device) or {}
model = model_details["model"] if model_details else None model = model_details.get("model")
self._attr_device_info = DeviceInfo( self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, serial_num)}, identifiers={(DOMAIN, serial_num)},
name=self.device.account_name, name=self.device.account_name,
model=model, model=model,
model_id=self.device.device_type, model_id=self.device.device_type,
manufacturer="Amazon", manufacturer=model_details.get("manufacturer", "Amazon"),
hw_version=model_details["hw_version"] if model_details else None, hw_version=model_details.get("hw_version"),
sw_version=( sw_version=(
self.device.software_version if model != SPEAKER_GROUP_MODEL else None self.device.software_version if model != SPEAKER_GROUP_MODEL else None
), ),