Exception handling for BT-Player control, if no player available
This commit is contained in:
parent
8cf4e1da2c
commit
6388afa835
@ -50,6 +50,7 @@ def on_property_changed(interface, changed, invalidated):
|
||||
|
||||
|
||||
def on_mqtt_ctrl(client, userdata, message):
|
||||
try:
|
||||
if message.topic == config.MQTT_TOPIC + "/PLAY":
|
||||
player_iface.Play()
|
||||
elif message.topic == config.MQTT_TOPIC + "/PAUSE":
|
||||
@ -60,7 +61,8 @@ def on_mqtt_ctrl(client, userdata, message):
|
||||
player_iface.Next()
|
||||
else:
|
||||
logger.info(message.topic)
|
||||
|
||||
except AttributeError:
|
||||
logger.warning("Player control impossible due to no player available.")
|
||||
|
||||
if __name__ == "__main__":
|
||||
report.stdoutLoggingConfigure(((config.APP_NAME, config.LOGLVL), ), fmt=config.formatter)
|
||||
|
Loading…
x
Reference in New Issue
Block a user