Skip to content

Implement MQTT events#15

Draft
Sholofly wants to merge 2 commits into
cgarwood:masterfrom
Sholofly:mqttv2
Draft

Implement MQTT events#15
Sholofly wants to merge 2 commits into
cgarwood:masterfrom
Sholofly:mqttv2

Conversation

@Sholofly

@Sholofly Sholofly commented Nov 6, 2022

Copy link
Copy Markdown

Second attempt to implement an eventlistener based on MQTT.

How to use?
After creating the fully kiosk class call the start() function with a parameter callback function:

def on_event_callback(event_type:str):
    print(event_type)
    # For example: Pass function for sensor refresh here when event_type == deviceInfo
    # event_type: deviceInfo updates the device info in the api, so technically you don't need to call the getDeviceClass 
    # seperately anymore

session = ClientSession()
api = FullyKiosk(session, "<host-ip>", <port>, '<admin-password>')`
await api.start(mqtt_event_callback=on_event_callback)

@Sholofly

Sholofly commented Nov 6, 2022

Copy link
Copy Markdown
Author

@cgarwood Do you mind to take a look?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant