Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.mysensors.gateway Namespace Reference

Functions

None _discover_persistent_devices (HomeAssistant hass, ConfigEntry entry, BaseAsyncGateway gateway)
 
BaseAsyncGateway|None _get_gateway (HomeAssistant hass, ConfGatewayType gateway_type, str device, str version, Callable[[Message], None] event_callback, str|None persistence_file=None, int|None baud_rate=None, int|None tcp_port=None, str|None topic_in_prefix=None, str|None topic_out_prefix=None, bool retain=False, bool persistence=True)
 
Callable[[Message], None] _gw_callback_factory (HomeAssistant hass, GatewayId gateway_id)
 
None _gw_start (HomeAssistant hass, ConfigEntry entry, BaseAsyncGateway gateway)
 
None finish_setup (HomeAssistant hass, ConfigEntry entry, BaseAsyncGateway gateway)
 
None gw_stop (HomeAssistant hass, ConfigEntry entry, BaseAsyncGateway gateway)
 
str is_serial_port (str value)
 
str is_socket_address (str value)
 
BaseAsyncGateway|None setup_gateway (HomeAssistant hass, ConfigEntry entry)
 
bool try_connect (HomeAssistant hass, ConfGatewayType gateway_type, dict[str, Any] user_input)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
float GATEWAY_READY_TIMEOUT = 20.0
 
string MQTT_COMPONENT = "mqtt"
 

Detailed Description

Handle MySensors gateways.

Function Documentation

◆ _discover_persistent_devices()

None homeassistant.components.mysensors.gateway._discover_persistent_devices ( HomeAssistant  hass,
ConfigEntry  entry,
BaseAsyncGateway   gateway 
)
private
Discover platforms for devices loaded via persistence file.

Definition at line 245 of file gateway.py.

◆ _get_gateway()

BaseAsyncGateway | None homeassistant.components.mysensors.gateway._get_gateway ( HomeAssistant  hass,
ConfGatewayType  gateway_type,
str  device,
str  version,
Callable[[Message], None]  event_callback,
str | None   persistence_file = None,
int | None   baud_rate = None,
int | None   tcp_port = None,
str | None   topic_in_prefix = None,
str | None   topic_out_prefix = None,
bool   retain = False,
bool   persistence = True 
)
private
Return gateway after setup of the gateway.

Definition at line 150 of file gateway.py.

◆ _gw_callback_factory()

Callable[[Message], None] homeassistant.components.mysensors.gateway._gw_callback_factory ( HomeAssistant  hass,
GatewayId   gateway_id 
)
private
Return a new callback for the gateway.

Definition at line 316 of file gateway.py.

◆ _gw_start()

None homeassistant.components.mysensors.gateway._gw_start ( HomeAssistant  hass,
ConfigEntry  entry,
BaseAsyncGateway   gateway 
)
private
Start the gateway.

Definition at line 276 of file gateway.py.

◆ finish_setup()

None homeassistant.components.mysensors.gateway.finish_setup ( HomeAssistant  hass,
ConfigEntry  entry,
BaseAsyncGateway   gateway 
)
Load any persistent devices and platforms and start gateway.

Definition at line 237 of file gateway.py.

◆ gw_stop()

None homeassistant.components.mysensors.gateway.gw_stop ( HomeAssistant  hass,
ConfigEntry  entry,
BaseAsyncGateway   gateway 
)
Stop the gateway.

Definition at line 264 of file gateway.py.

◆ is_serial_port()

str homeassistant.components.mysensors.gateway.is_serial_port ( str  value)
Validate that value is a windows serial port or a unix device.

Definition at line 61 of file gateway.py.

◆ is_socket_address()

str homeassistant.components.mysensors.gateway.is_socket_address ( str  value)
Validate that value is a valid address.

Definition at line 71 of file gateway.py.

◆ setup_gateway()

BaseAsyncGateway | None homeassistant.components.mysensors.gateway.setup_gateway ( HomeAssistant  hass,
ConfigEntry   entry 
)
Set up the Gateway for the given ConfigEntry.

Definition at line 128 of file gateway.py.

◆ try_connect()

bool homeassistant.components.mysensors.gateway.try_connect ( HomeAssistant  hass,
ConfGatewayType  gateway_type,
dict[str, Any]   user_input 
)
Try to connect to a gateway and report if it worked.

Definition at line 80 of file gateway.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.mysensors.gateway._LOGGER = logging.getLogger(__name__)
private

Definition at line 55 of file gateway.py.

◆ GATEWAY_READY_TIMEOUT

float homeassistant.components.mysensors.gateway.GATEWAY_READY_TIMEOUT = 20.0

Definition at line 57 of file gateway.py.

◆ MQTT_COMPONENT

string homeassistant.components.mysensors.gateway.MQTT_COMPONENT = "mqtt"

Definition at line 58 of file gateway.py.