Skip to content

Instantly share code, notes, and snippets.

{
"retry_interval": 20,
"sys_interval": 10,
"listeners": {
"port": 1883,
"max_connections": -1,
"auth_plugin": {
"plugin_path": "auth-plug.so",
@ralight
ralight / pygtk-resize.py
Created February 12, 2020 14:26
Resize gtk window programmatically - smaller
import gi
gi.require_version('Gtk', '3.0')
from gi.repository import Gtk
import sys
class Main(object):
def __init__(self):
self.window = None
self.width = 500
self.height = 500
import paho.mqtt.subscribe as subscribe
import json
import os
def on_message(client, userdata, msg):
#print(msg.topic+" "+str(msg.payload))
payload = json.loads(msg.payload)
if "action" in payload and "rgb" in payload and "mac" in payload:
if payload['mac'] == "23:02:04:00:01:c6":
r,g,b = payload['rgb']