remove wildcard stuff
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2021-06-12 20:30:09 +02:00
parent 10eca03eb1
commit ad567ba2d1
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047
2 changed files with 2 additions and 27 deletions

View File

@ -48,9 +48,10 @@ app.config['MQTT_REFRESH_TIME'] = 1.0 # refresh time in seconds
api = Api(app)
mqtt.init_app(app)
@mqtt.on_log()
def handle_logging(client, userdata, level, buf):
logger.log(level, buf)
app.logger.log(level, buf)
@mqtt.on_connect()
@ -67,8 +68,6 @@ def handle_status_message_proxy(*args, **kwargs):
handle_status_message(*args, **kwargs)
api.add_resource(AllDevicesOfflineResource, "/devices/offline")
api.add_resource(AllDevicesOnlineResource, "/devices/online")
api.add_resource(DeviceOfflineResrouce, "/devices/{deviceid}/offline")
api.add_resource(DeviceOnlineResrouce, "/devices/{deviceid}/online")
api.add_resource(SensorOfflineResource, "/devices/{deviceid}/{sensorid}/offline")

View File

@ -13,30 +13,6 @@ __module_name__ = "resources"
__version__text__ = "1"
class AllDevicesOfflineResource(Resource):
"""
Shut down all devices
"""
def post(self):
"""
Shut down every device
:return:
"""
mqtt.publish(f"{config.MQTT_COMMAND_TOPIC}/+", {"command": "offline"})
class AllDevicesOnlineResource(Resource):
"""
Bring every device online
"""
def post(self):
"""
Bring every device online
:return:
"""
mqtt.publish(f"{config.MQTT_COMMAND_TOPIC}/+", {"command": "online"})
class DeviceOfflineResrouce(Resource):
"""
Bring a device offline