Gateway
It is the home instance gateway to the Knx bus. Connects triggers and commands to the KNX bus. It depends on the physical connecting device, it could be both a USB HID device or a KNXNET IP device.
Abstract
- class knx_plugin.gateway.Gateway(client: knx_plugin.Client, host: str = '0.0.0.0', port: int = 5555)
- PROTOCOL = 'knx'
- property protocol_instance
- async disconnect() None
- associate_commands(descriptions: knx_plugin.message.Command) None
Connect the Protocol Commands with the Gateway, if needed.
Only connected commands should go through the Gateway to the bus.
- Parameters
descriptions – a protocol message description
- Returns
an association object, if any
- associate_triggers(descriptions: knx_plugin.message.Trigger) None
Connect the Protocol Triggers with the Gateway, if needed.
Only connected triggers should go through the Gateway from the bus.
- Parameters
descriptions – a protocol message description
- Returns
an association object, if any
- async run(other_tasks: Iterable[Callable]) None
Create an asynchronous task capable of receiving messages from the bus.
Every received message becomes a Protocol Trigger.
Every created Protocol Trigger goes through given tasks to be processed.
- Parameters
tasks – a function capable of process a Protocol Trigger
- static make_trigger(msg: Union[knx_stack.definition.layer.application.a_group_value_write.ind.Msg, knx_stack.definition.layer.application.a_group_value_read.ind.Msg])
Make a Protocol Trigger from a protocol message.
- Parameters
msg – a protocol message
- Returns
a Protocol Trigger
- async writer(msgs: Iterable[Union[knx_stack.definition.layer.application.a_group_value_write.req.Msg, knx_stack.definition.layer.application.a_group_value_read.req.Msg]], *args)
A function capable of sending protocol messages to the bus.
- Parameters
msgs – a protocol messages
args –
USB HID
- class knx_plugin.gateway.usbhid.Gateway(client, host='0.0.0.0', port=5555)
KNXNET IP
- class knx_plugin.gateway.knxnet_ip.Gateway(client, remote_host, remote_port, local_host, local_port, nat_local_host, nat_local_port)