Correct typing in azure_devops and activate mypy (#53152)
Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
This commit is contained in:
parent
327208c943
commit
0b60b86917
4 changed files with 3 additions and 8 deletions
|
@ -85,7 +85,7 @@ class AzureDevOpsDeviceEntity(AzureDevOpsEntity):
|
||||||
"""Return device information about this Azure DevOps instance."""
|
"""Return device information about this Azure DevOps instance."""
|
||||||
return {
|
return {
|
||||||
"identifiers": {
|
"identifiers": {
|
||||||
(
|
( # type: ignore
|
||||||
DOMAIN,
|
DOMAIN,
|
||||||
self.organization,
|
self.organization,
|
||||||
self.project,
|
self.project,
|
||||||
|
|
|
@ -97,7 +97,7 @@ class AzureDevOpsLatestBuildSensor(AzureDevOpsSensor):
|
||||||
"mdi:pipe",
|
"mdi:pipe",
|
||||||
)
|
)
|
||||||
|
|
||||||
async def _azure_devops_update(self) -> bool:
|
async def _azure_devops_update(self) -> None:
|
||||||
"""Update Azure DevOps entity."""
|
"""Update Azure DevOps entity."""
|
||||||
try:
|
try:
|
||||||
build: DevOpsBuild = await self.client.get_build(
|
build: DevOpsBuild = await self.client.get_build(
|
||||||
|
@ -106,7 +106,7 @@ class AzureDevOpsLatestBuildSensor(AzureDevOpsSensor):
|
||||||
except aiohttp.ClientError as exception:
|
except aiohttp.ClientError as exception:
|
||||||
_LOGGER.warning(exception)
|
_LOGGER.warning(exception)
|
||||||
self._attr_available = False
|
self._attr_available = False
|
||||||
return False
|
return
|
||||||
self._attr_state = build.build_number
|
self._attr_state = build.build_number
|
||||||
self._attr_extra_state_attributes = {
|
self._attr_extra_state_attributes = {
|
||||||
"definition_id": build.definition.id,
|
"definition_id": build.definition.id,
|
||||||
|
@ -123,4 +123,3 @@ class AzureDevOpsLatestBuildSensor(AzureDevOpsSensor):
|
||||||
"finish_time": build.finish_time,
|
"finish_time": build.finish_time,
|
||||||
}
|
}
|
||||||
self._attr_available = True
|
self._attr_available = True
|
||||||
return True
|
|
||||||
|
|
3
mypy.ini
3
mypy.ini
|
@ -1097,9 +1097,6 @@ ignore_errors = true
|
||||||
[mypy-homeassistant.components.awair.*]
|
[mypy-homeassistant.components.awair.*]
|
||||||
ignore_errors = true
|
ignore_errors = true
|
||||||
|
|
||||||
[mypy-homeassistant.components.azure_devops.*]
|
|
||||||
ignore_errors = true
|
|
||||||
|
|
||||||
[mypy-homeassistant.components.azure_event_hub.*]
|
[mypy-homeassistant.components.azure_event_hub.*]
|
||||||
ignore_errors = true
|
ignore_errors = true
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,6 @@ IGNORED_MODULES: Final[list[str]] = [
|
||||||
"homeassistant.components.atag.*",
|
"homeassistant.components.atag.*",
|
||||||
"homeassistant.components.aurora.*",
|
"homeassistant.components.aurora.*",
|
||||||
"homeassistant.components.awair.*",
|
"homeassistant.components.awair.*",
|
||||||
"homeassistant.components.azure_devops.*",
|
|
||||||
"homeassistant.components.azure_event_hub.*",
|
"homeassistant.components.azure_event_hub.*",
|
||||||
"homeassistant.components.blueprint.*",
|
"homeassistant.components.blueprint.*",
|
||||||
"homeassistant.components.bmw_connected_drive.*",
|
"homeassistant.components.bmw_connected_drive.*",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue