mqtt_client.py: remove mixer import
This commit is contained in:
parent
3a97a7a059
commit
14c4ec65ee
1 changed files with 3 additions and 4 deletions
|
@ -4,7 +4,6 @@ import argparse
|
||||||
import json
|
import json
|
||||||
|
|
||||||
import paho.mqtt.client as mqtt
|
import paho.mqtt.client as mqtt
|
||||||
import mixer
|
|
||||||
from mixer import Mixer
|
from mixer import Mixer
|
||||||
|
|
||||||
|
|
||||||
|
@ -14,7 +13,7 @@ class MqttClient:
|
||||||
MQTT_COMMAND_TOPIC = "livingroom/voc/allen_heath_qu16_mixer"
|
MQTT_COMMAND_TOPIC = "livingroom/voc/allen_heath_qu16_mixer"
|
||||||
|
|
||||||
def __init__(self, mixer_ip):
|
def __init__(self, mixer_ip):
|
||||||
self.m = mixer.Mixer(mixer_ip)
|
self.mixer = Mixer(mixer_ip)
|
||||||
self.client = mqtt.Client(callback_api_version=mqtt.CallbackAPIVersion.VERSION2)
|
self.client = mqtt.Client(callback_api_version=mqtt.CallbackAPIVersion.VERSION2)
|
||||||
|
|
||||||
def mqtt_autodiscovery(self, client):
|
def mqtt_autodiscovery(self, client):
|
||||||
|
@ -51,9 +50,9 @@ class MqttClient:
|
||||||
|
|
||||||
match j["command"]:
|
match j["command"]:
|
||||||
case "scene_recall":
|
case "scene_recall":
|
||||||
self.m.scene_recall(j["args"]["scene_id"])
|
self.mixer.scene_recall(j["args"]["scene_id"])
|
||||||
case "shutdown":
|
case "shutdown":
|
||||||
self.m.shutdown()
|
self.mixer.shutdown()
|
||||||
|
|
||||||
def run(self, hostname):
|
def run(self, hostname):
|
||||||
self.client.on_connect = self.on_connect
|
self.client.on_connect = self.on_connect
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue