diff --git a/homeassistant/components/axis/hub/event_source.py b/homeassistant/components/axis/hub/event_source.py index d295639d1a676..48718606b6bf9 100644 --- a/homeassistant/components/axis/hub/event_source.py +++ b/homeassistant/components/axis/hub/event_source.py @@ -76,7 +76,7 @@ def _mqtt_message(self, message: ReceiveMessage) -> None: if message.topic.endswith("event/connection"): return - event = mqtt_json_to_event(message.payload) + event = mqtt_json_to_event(message.payload) # type: ignore[arg-type] self.api.event.handler(event) @callback diff --git a/homeassistant/components/image/__init__.py b/homeassistant/components/image/__init__.py index dbb5962eabf5f..ea23512789455 100644 --- a/homeassistant/components/image/__init__.py +++ b/homeassistant/components/image/__init__.py @@ -348,7 +348,7 @@ async def _write_frame() -> bool: # While this results in additional bandwidth usage, # given the low frequency of image updates, it is acceptable. frame.extend(frame) - await response.write(frame) + await response.write(frame) # type: ignore[arg-type] return True event = asyncio.Event() diff --git a/homeassistant/components/mqtt/client.py b/homeassistant/components/mqtt/client.py index d8bc0862d29c9..0091d2370a4f3 100644 --- a/homeassistant/components/mqtt/client.py +++ b/homeassistant/components/mqtt/client.py @@ -119,7 +119,7 @@ type SocketType = socket.socket | ssl.SSLSocket | mqtt.WebsocketWrapper | Any -type SubscribePayloadType = str | bytes # Only bytes if encoding is None +type SubscribePayloadType = str | bytes | bytearray # Only bytes if encoding is None def publish( diff --git a/homeassistant/components/mqtt/switch.py b/homeassistant/components/mqtt/switch.py index c90174e8a0122..0a54bcdb37812 100644 --- a/homeassistant/components/mqtt/switch.py +++ b/homeassistant/components/mqtt/switch.py @@ -91,7 +91,7 @@ class MqttSwitch(MqttEntity, SwitchEntity, RestoreEntity): _entity_id_format = switch.ENTITY_ID_FORMAT _optimistic: bool - _is_on_map: dict[str | bytes, bool | None] + _is_on_map: dict[str | bytes | bytearray, bool | None] _command_template: Callable[[PublishPayloadType], PublishPayloadType] _value_template: Callable[[ReceivePayloadType], ReceivePayloadType] diff --git a/homeassistant/helpers/service_info/mqtt.py b/homeassistant/helpers/service_info/mqtt.py index 6ffc981ced104..a528480761772 100644 --- a/homeassistant/helpers/service_info/mqtt.py +++ b/homeassistant/helpers/service_info/mqtt.py @@ -4,7 +4,7 @@ from homeassistant.data_entry_flow import BaseServiceInfo -type ReceivePayloadType = str | bytes +type ReceivePayloadType = str | bytes | bytearray @dataclass(slots=True)