class documentation

class Block(MQTTAgent):

Constructor: Block(rc_block)

View In Hierarchy

Block Agent

This agent is used to handle publications to the RailCom topic and any publications it makes.

Method __init__ Construct the Block agent
Method handle_publication Handle a publication This method is called by the MQTT client when a publication is received.
Constant REPORTER_TOPIC_PREFIX Undocumented
Method _create_pub_check Overrides version in base class
Async Method _pub_check Publication check
Instance Variable _last_blk_state Undocumented
Instance Variable _name Undocumented
Instance Variable _rc_block Undocumented
def __init__(self, rc_block):

Construct the Block agent

Create object variables and initialise the base Agent class topic and QoS

def handle_publication(self, topic, dup_flag, ret_flag, payload):

Handle a publication This method is called by the MQTT client when a publication is received.

Parameters
topicthe topic of the publication
dup_flagTrue if this is a duplicate publication
ret_flagTrue if this is a retained publication
payloadthe payload of the publication as a string
REPORTER_TOPIC_PREFIX: str =

Undocumented

Value
'rcom/lcl'
def _create_pub_check(self):

Overrides version in base class

async def _pub_check(self):

Publication check

Check to see if block state has changed and publish it.

This coroutine runs forever.

_last_blk_state =

Undocumented

_name =

Undocumented

_rc_block =

Undocumented