Bump pydantic constraint (#116401)
Co-authored-by: J. Nick Koston <nick@koston.org>pull/116394/head
parent
9995207817
commit
c7a84b1c7b
|
@ -363,9 +363,7 @@ class BangOlufsenMediaPlayer(BangOlufsenEntity, MediaPlayerEntity):
|
||||||
def is_volume_muted(self) -> bool | None:
|
def is_volume_muted(self) -> bool | None:
|
||||||
"""Boolean if volume is currently muted."""
|
"""Boolean if volume is currently muted."""
|
||||||
if self._volume.muted and self._volume.muted.muted:
|
if self._volume.muted and self._volume.muted.muted:
|
||||||
# The any return here is side effect of pydantic v2 compatibility
|
return self._volume.muted.muted
|
||||||
# This will be fixed in the future.
|
|
||||||
return self._volume.muted.muted # type: ignore[no-any-return]
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
|
|
@ -155,7 +155,7 @@ async def async_setup_entry(
|
||||||
@callback
|
@callback
|
||||||
def _add_new_device(device: ProtectAdoptableDeviceModel) -> None:
|
def _add_new_device(device: ProtectAdoptableDeviceModel) -> None:
|
||||||
if not isinstance(device, UFPCamera):
|
if not isinstance(device, UFPCamera):
|
||||||
return # type: ignore[unreachable]
|
return
|
||||||
|
|
||||||
entities = _async_camera_entities(hass, entry, data, ufp_device=device)
|
entities = _async_camera_entities(hass, entry, data, ufp_device=device)
|
||||||
async_add_entities(entities)
|
async_add_entities(entities)
|
||||||
|
|
|
@ -226,7 +226,7 @@ class ProtectData:
|
||||||
self._async_update_device(obj, message.changed_data)
|
self._async_update_device(obj, message.changed_data)
|
||||||
|
|
||||||
# trigger updates for camera that the event references
|
# trigger updates for camera that the event references
|
||||||
elif isinstance(obj, Event): # type: ignore[unreachable]
|
elif isinstance(obj, Event):
|
||||||
if _LOGGER.isEnabledFor(logging.DEBUG):
|
if _LOGGER.isEnabledFor(logging.DEBUG):
|
||||||
log_event(obj)
|
log_event(obj)
|
||||||
if obj.type is EventType.DEVICE_ADOPTED:
|
if obj.type is EventType.DEVICE_ADOPTED:
|
||||||
|
|
|
@ -267,7 +267,7 @@ class ProtectDeviceEntity(Entity):
|
||||||
return (self._attr_available,)
|
return (self._attr_available,)
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def _async_updated_event(self, device: ProtectModelWithId) -> None:
|
def _async_updated_event(self, device: ProtectAdoptableDeviceModel | NVR) -> None:
|
||||||
"""When device is updated from Protect."""
|
"""When device is updated from Protect."""
|
||||||
|
|
||||||
previous_attrs = self._async_get_state_attrs()
|
previous_attrs = self._async_get_state_attrs()
|
||||||
|
@ -275,7 +275,7 @@ class ProtectDeviceEntity(Entity):
|
||||||
current_attrs = self._async_get_state_attrs()
|
current_attrs = self._async_get_state_attrs()
|
||||||
if previous_attrs != current_attrs:
|
if previous_attrs != current_attrs:
|
||||||
if _LOGGER.isEnabledFor(logging.DEBUG):
|
if _LOGGER.isEnabledFor(logging.DEBUG):
|
||||||
device_name = device.name
|
device_name = device.name or ""
|
||||||
if hasattr(self, "entity_description") and self.entity_description.name:
|
if hasattr(self, "entity_description") and self.entity_description.name:
|
||||||
device_name += f" {self.entity_description.name}"
|
device_name += f" {self.entity_description.name}"
|
||||||
|
|
||||||
|
@ -302,7 +302,7 @@ class ProtectNVREntity(ProtectDeviceEntity):
|
||||||
"""Base class for unifi protect entities."""
|
"""Base class for unifi protect entities."""
|
||||||
|
|
||||||
# separate subclass on purpose
|
# separate subclass on purpose
|
||||||
device: NVR
|
device: NVR # type: ignore[assignment]
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
|
@ -311,7 +311,7 @@ class ProtectNVREntity(ProtectDeviceEntity):
|
||||||
description: EntityDescription | None = None,
|
description: EntityDescription | None = None,
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Initialize the entity."""
|
"""Initialize the entity."""
|
||||||
super().__init__(entry, device, description)
|
super().__init__(entry, device, description) # type: ignore[arg-type]
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
def _async_set_device_info(self) -> None:
|
def _async_set_device_info(self) -> None:
|
||||||
|
|
|
@ -133,7 +133,7 @@ backoff>=2.0
|
||||||
|
|
||||||
# Required to avoid breaking (#101042).
|
# Required to avoid breaking (#101042).
|
||||||
# v2 has breaking changes (#99218).
|
# v2 has breaking changes (#99218).
|
||||||
pydantic==1.10.12
|
pydantic==1.10.15
|
||||||
|
|
||||||
# Breaks asyncio
|
# Breaks asyncio
|
||||||
# https://github.com/pubnub/python/issues/130
|
# https://github.com/pubnub/python/issues/130
|
||||||
|
|
|
@ -13,7 +13,7 @@ freezegun==1.5.0
|
||||||
mock-open==1.4.0
|
mock-open==1.4.0
|
||||||
mypy==1.10.0
|
mypy==1.10.0
|
||||||
pre-commit==3.7.0
|
pre-commit==3.7.0
|
||||||
pydantic==1.10.12
|
pydantic==1.10.15
|
||||||
pylint==3.1.0
|
pylint==3.1.0
|
||||||
pylint-per-file-ignores==1.3.2
|
pylint-per-file-ignores==1.3.2
|
||||||
pipdeptree==2.19.0
|
pipdeptree==2.19.0
|
||||||
|
|
|
@ -155,7 +155,7 @@ backoff>=2.0
|
||||||
|
|
||||||
# Required to avoid breaking (#101042).
|
# Required to avoid breaking (#101042).
|
||||||
# v2 has breaking changes (#99218).
|
# v2 has breaking changes (#99218).
|
||||||
pydantic==1.10.12
|
pydantic==1.10.15
|
||||||
|
|
||||||
# Breaks asyncio
|
# Breaks asyncio
|
||||||
# https://github.com/pubnub/python/issues/130
|
# https://github.com/pubnub/python/issues/130
|
||||||
|
|
Loading…
Reference in New Issue