influxdata / influxdata/ui

MESURE DU COURENT

Open
#7,084 0 comments 0 reactions 0 assignees View on GitHub
kind/bug team/ui
Dominant language
TypeScript
Stars
117
Forks
51
Avg merge
2d 15h
Merged PRs (30d)
4

Description

import paho.mqtt.client as mqtt
import mysql.connector
import json

db = mysql.connector.connect(
host="localhost", user="root", password="root", database="qos_mqtt"
)
cursor = db.cursor()

def on_message(client, userdata, message):
data = json.loads(message.payload.decode())
sql = "INSERT INTO mesures_sources (source, tension, courant, puissance, temperature) VALUES (%s,%s,%s,%s,%s)"
values = (data['source'], data['tension'], data['courant'], data['tension']*data['courant'], data['temperature'])
cursor.execute(sql, values)
db.commit()

client = mqtt.Client()
client.connect("localhost")
client.subscribe("energie/#", qos=1)
client.on_message = on_message
client.loop_forever()

Contributor guide

No contributing guide indexed for this repository

Research direction

The body contains a standalone Python script using paho-mqtt and mysql.connector, but it names no repository file, test, or requested change. First confirm whether this code is intended for influxdata/ui and clarify the expected behavior. There is currently no stated completion criterion.

Written by the indexing model from the issue text.

Assessment

Tech stack
mysql, python
Domain
backend, databases
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
10/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.