elad-bar / DahuaVTO2MQTT

Listens to events from Dahua VTO unit and publishes them via MQTT Message
104 stars 38 forks source link

Cancel Call - MQTT-Command #50

Open bazidibavaria opened 3 years ago

bazidibavaria commented 3 years ago

Hi,

to stop a call, a new function can be integrated

DAHUA_CONSOLE_RUN_CMD = "console.runCmd"

def console_run_cmd_cancel_call(self):
    _LOGGER.debug("Cancel call")

    def handle_console_run_cmd_cancel_call(message):
        _LOGGER.info(f"Cancel call msg: {message}")

    request_data = {
        "command": "hc"
    }

    self.send(DAHUA_CONSOLE_RUN_CMD, handle_console_run_cmd_cancel_call, request_data)

Additionally a mqtt subscription to an command event should be integrated.