diff --git a/homeassistant/components/bang_olufsen/media_player.py b/homeassistant/components/bang_olufsen/media_player.py index 9f55790d711..935c057efc8 100644 --- a/homeassistant/components/bang_olufsen/media_player.py +++ b/homeassistant/components/bang_olufsen/media_player.py @@ -363,9 +363,7 @@ class BangOlufsenMediaPlayer(BangOlufsenEntity, MediaPlayerEntity): def is_volume_muted(self) -> bool | None: """Boolean if volume is currently muted.""" if self._volume.muted and self._volume.muted.muted: - # The any return here is side effect of pydantic v2 compatibility - # This will be fixed in the future. - return self._volume.muted.muted # type: ignore[no-any-return] + return self._volume.muted.muted return None @property diff --git a/homeassistant/components/unifiprotect/camera.py b/homeassistant/components/unifiprotect/camera.py index 1e99bdff541..8e10c09872b 100644 --- a/homeassistant/components/unifiprotect/camera.py +++ b/homeassistant/components/unifiprotect/camera.py @@ -155,7 +155,7 @@ async def async_setup_entry( @callback def _add_new_device(device: ProtectAdoptableDeviceModel) -> None: if not isinstance(device, UFPCamera): - return # type: ignore[unreachable] + return entities = _async_camera_entities(hass, entry, data, ufp_device=device) async_add_entities(entities) diff --git a/homeassistant/components/unifiprotect/data.py b/homeassistant/components/unifiprotect/data.py index 55ddf91d3cb..6c5a1472015 100644 --- a/homeassistant/components/unifiprotect/data.py +++ b/homeassistant/components/unifiprotect/data.py @@ -226,7 +226,7 @@ class ProtectData: self._async_update_device(obj, message.changed_data) # trigger updates for camera that the event references - elif isinstance(obj, Event): # type: ignore[unreachable] + elif isinstance(obj, Event): if _LOGGER.isEnabledFor(logging.DEBUG): log_event(obj) if obj.type is EventType.DEVICE_ADOPTED: diff --git a/homeassistant/components/unifiprotect/entity.py b/homeassistant/components/unifiprotect/entity.py index 932cc75b9d0..49478ce0582 100644 --- a/homeassistant/components/unifiprotect/entity.py +++ b/homeassistant/components/unifiprotect/entity.py @@ -267,7 +267,7 @@ class ProtectDeviceEntity(Entity): return (self._attr_available,) @callback - def _async_updated_event(self, device: ProtectModelWithId) -> None: + def _async_updated_event(self, device: ProtectAdoptableDeviceModel | NVR) -> None: """When device is updated from Protect.""" previous_attrs = self._async_get_state_attrs() @@ -275,7 +275,7 @@ class ProtectDeviceEntity(Entity): current_attrs = self._async_get_state_attrs() if previous_attrs != current_attrs: if _LOGGER.isEnabledFor(logging.DEBUG): - device_name = device.name + device_name = device.name or "" if hasattr(self, "entity_description") and self.entity_description.name: device_name += f" {self.entity_description.name}" @@ -302,7 +302,7 @@ class ProtectNVREntity(ProtectDeviceEntity): """Base class for unifi protect entities.""" # separate subclass on purpose - device: NVR + device: NVR # type: ignore[assignment] def __init__( self, @@ -311,7 +311,7 @@ class ProtectNVREntity(ProtectDeviceEntity): description: EntityDescription | None = None, ) -> None: """Initialize the entity.""" - super().__init__(entry, device, description) + super().__init__(entry, device, description) # type: ignore[arg-type] @callback def _async_set_device_info(self) -> None: diff --git a/homeassistant/package_constraints.txt b/homeassistant/package_constraints.txt index 4ba38346e83..e9705b40bd0 100644 --- a/homeassistant/package_constraints.txt +++ b/homeassistant/package_constraints.txt @@ -133,7 +133,7 @@ backoff>=2.0 # Required to avoid breaking (#101042). # v2 has breaking changes (#99218). -pydantic==1.10.12 +pydantic==1.10.15 # Breaks asyncio # https://github.com/pubnub/python/issues/130 diff --git a/requirements_test.txt b/requirements_test.txt index 50ae06c9566..e932e9ff6ab 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -13,7 +13,7 @@ freezegun==1.5.0 mock-open==1.4.0 mypy==1.10.0 pre-commit==3.7.0 -pydantic==1.10.12 +pydantic==1.10.15 pylint==3.1.0 pylint-per-file-ignores==1.3.2 pipdeptree==2.19.0 diff --git a/script/gen_requirements_all.py b/script/gen_requirements_all.py index a5db9997d9d..602a9fe934b 100755 --- a/script/gen_requirements_all.py +++ b/script/gen_requirements_all.py @@ -155,7 +155,7 @@ backoff>=2.0 # Required to avoid breaking (#101042). # v2 has breaking changes (#99218). -pydantic==1.10.12 +pydantic==1.10.15 # Breaks asyncio # https://github.com/pubnub/python/issues/130