mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 18:27:09 +00:00
Allow bytearray for mqtt payload type (#132906)
This commit is contained in:
parent
b26583b0bf
commit
dc8b7cfede
@ -119,7 +119,7 @@ MAX_PACKETS_TO_READ = 500
|
|||||||
|
|
||||||
type SocketType = socket.socket | ssl.SSLSocket | mqtt.WebsocketWrapper | Any
|
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(
|
def publish(
|
||||||
|
@ -91,7 +91,7 @@ class MqttSwitch(MqttEntity, SwitchEntity, RestoreEntity):
|
|||||||
_entity_id_format = switch.ENTITY_ID_FORMAT
|
_entity_id_format = switch.ENTITY_ID_FORMAT
|
||||||
|
|
||||||
_optimistic: bool
|
_optimistic: bool
|
||||||
_is_on_map: dict[str | bytes, bool | None]
|
_is_on_map: dict[str | bytes | bytearray, bool | None]
|
||||||
_command_template: Callable[[PublishPayloadType], PublishPayloadType]
|
_command_template: Callable[[PublishPayloadType], PublishPayloadType]
|
||||||
_value_template: Callable[[ReceivePayloadType], ReceivePayloadType]
|
_value_template: Callable[[ReceivePayloadType], ReceivePayloadType]
|
||||||
|
|
||||||
|
@ -4,7 +4,7 @@ from dataclasses import dataclass
|
|||||||
|
|
||||||
from homeassistant.data_entry_flow import BaseServiceInfo
|
from homeassistant.data_entry_flow import BaseServiceInfo
|
||||||
|
|
||||||
type ReceivePayloadType = str | bytes
|
type ReceivePayloadType = str | bytes | bytearray
|
||||||
|
|
||||||
|
|
||||||
@dataclass(slots=True)
|
@dataclass(slots=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user