Skip to content

Commit

Permalink
Allow bytearray for mqtt payload type
Browse files Browse the repository at this point in the history
  • Loading branch information
cdce8p committed Dec 11, 2024
1 parent 9c9e82a commit bc64d09
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/mqtt/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/mqtt/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand Down
2 changes: 1 addition & 1 deletion homeassistant/helpers/service_info/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from homeassistant.data_entry_flow import BaseServiceInfo

type ReceivePayloadType = str | bytes
type ReceivePayloadType = str | bytes | bytearray


@dataclass(slots=True)
Expand Down

0 comments on commit bc64d09

Please sign in to comment.