Skip to content

Instantly share code, notes, and snippets.

@barakplasma
Last active September 23, 2021 13:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save barakplasma/2a7e257740750a658699da0effe44c9f to your computer and use it in GitHub Desktop.
Save barakplasma/2a7e257740750a658699da0effe44c9f to your computer and use it in GitHub Desktop.
classDiagram
direction RL
Tasmota --> MqttBroker: Tasmota publishes sensor readings to broker
class Tasmota{
publish()
}
class MqttBroker {
message_queue
}
Mqttjs --> Chartjs: onRecieve pushes new data and updates Chart
IndexedDB <-- Chartjs: reads data from DB on first page load
class Chartjs {
update()
push()
dataPoints: readings[]
}
Mqttjs --> MqttBroker : Mqttjs subscribes to messages in MqttBroker
Mqttjs <-- MqttBroker : MqttBroker sends new message over WebSocket
class Mqttjs {
subscribe()
onReceive()
}
Mqttjs --> IndexedDB : onReceive adds data to object store using transaction
class IndexedDB {
transaction()
createObjectStore()
createIndex()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment