parent
af4a49f149
commit
ac0497438d
|
@ -41,13 +41,12 @@ db = MySQLdb.connect(
|
||||||
)
|
)
|
||||||
|
|
||||||
db.autocommit(True)
|
db.autocommit(True)
|
||||||
cur = db.cursor()
|
|
||||||
|
|
||||||
mqtt_client_id = "PiXelTubeMaster-"+wlan_mac_address
|
mqtt_client_id = "PiXelTubeMaster-"+wlan_mac_address
|
||||||
|
|
||||||
# Function to register a tube in the database
|
# Function to register a tube in the database
|
||||||
def register_tube(mac_address):
|
def register_tube(mac_address):
|
||||||
|
cur = db.cursor()
|
||||||
# Check if the tube already exists in the database
|
# Check if the tube already exists in the database
|
||||||
cur.execute("SELECT * FROM tubes WHERE mac_address = %s", (mac_address,))
|
cur.execute("SELECT * FROM tubes WHERE mac_address = %s", (mac_address,))
|
||||||
existing_tube = cur.fetchone()
|
existing_tube = cur.fetchone()
|
||||||
|
@ -115,6 +114,7 @@ def start_mqtt_publishers():
|
||||||
mqtt_client = connect_mqtt()
|
mqtt_client = connect_mqtt()
|
||||||
artnetBindIp = get_eth0_ip()
|
artnetBindIp = get_eth0_ip()
|
||||||
artNet = Artnet.Artnet(BINDIP = artnetBindIp, DEBUG = True, SHORTNAME = "PiXelTubeMaster", LONGNAME = "PiXelTubeMaster", PORT = 6454)
|
artNet = Artnet.Artnet(BINDIP = artnetBindIp, DEBUG = True, SHORTNAME = "PiXelTubeMaster", LONGNAME = "PiXelTubeMaster", PORT = 6454)
|
||||||
|
cur = db.cursor()
|
||||||
cur.execute("SELECT mac_address, universe, dmx_address FROM tubes")
|
cur.execute("SELECT mac_address, universe, dmx_address FROM tubes")
|
||||||
global result
|
global result
|
||||||
result = cur.fetchall()
|
result = cur.fetchall()
|
||||||
|
|
Loading…
Reference in New Issue