Review comments on earlier merge. (#53221)

This commit is contained in:
jan iversen 2021-07-20 13:00:07 +02:00 committed by GitHub
parent d17776af87
commit 51dd95ce35
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -97,7 +97,7 @@ class AzureDevOpsLatestBuildSensor(AzureDevOpsSensor):
"mdi:pipe",
)
async def _azure_devops_update(self) -> None:
async def _azure_devops_update(self) -> bool:
"""Update Azure DevOps entity."""
try:
build: DevOpsBuild = await self.client.get_build(
@ -106,7 +106,7 @@ class AzureDevOpsLatestBuildSensor(AzureDevOpsSensor):
except aiohttp.ClientError as exception:
_LOGGER.warning(exception)
self._attr_available = False
return
return False
self._attr_state = build.build_number
self._attr_extra_state_attributes = {
"definition_id": build.definition.id,
@ -123,3 +123,4 @@ class AzureDevOpsLatestBuildSensor(AzureDevOpsSensor):
"finish_time": build.finish_time,
}
self._attr_available = True
return True