taxisignservice script

taxisignservice

class taxisignservice.CommandlineDummyTaxisign[source]

Bases: object

Taxi sign simulator for command line.

Prints out whether the taxi sign is on or off.

* state

bool

Set to True to turn on the taxi sign.

broker_connectionstatus
close()[source]
loop()[source]
redraw()[source]
state
class taxisignservice.GraphicalDummyTaxisign[source]

Bases: taxisignservice.CommandlineDummyTaxisign

Graphical taxi sign simulator.

Shows a dark or bright taxi sign image in the GUI.

* state

bool

Set to True to turn on the taxi sign.

BROKERTEXT_TEMPLATE = 'Broker: {:<7s}'
DISPLAY_TITLE = 'Taxi sign simulator'
FILENAME_TAXISIGN_OFF = '/home/docs/checkouts/readthedocs.org/user_builds/sgframework/checkouts/latest/examples/taxisignservice/images/taxi_sign_off_small.gif'
FILENAME_TAXISIGN_ON = '/home/docs/checkouts/readthedocs.org/user_builds/sgframework/checkouts/latest/examples/taxisignservice/images/taxi_sign_on_small.gif'
close()[source]

Close the GUI

loop()[source]

Update the GUI

redraw()[source]
taxisignservice.init_taxisignservice()[source]

Initialize the taxi sign service.

Returns ..

taxisignservice.loop_taxisignservice(resource)[source]
taxisignservice.main()[source]
taxisignservice.on_broker_connectionstatus_info(resource, broker_connected)[source]

Callback for use when the broker connection status info is available.

taxisignservice.on_taxisign_state_command(resource, messagetype, servicename, commandname, commandpayload)[source]

Callback for use when receiving a MQTT message.

Sets the state of the taxi sign.

Returns the payload (str) that should be included in the command echo MQTT message.