cli: print response

This commit is contained in:
Robert Jördens 2021-03-03 14:40:34 +01:00
parent d6be11b351
commit baa2d0cdd5
1 changed files with 3 additions and 3 deletions

View File

@ -72,7 +72,7 @@ class Miniconf:
'Only one in-flight message per topic is supported') 'Only one in-flight message per topic is supported')
value = json.dumps(value) value = json.dumps(value)
logger.debug('Sending %s to "%s"', value, setting_topic) logger.info('Sending %s to "%s"', value, setting_topic)
fut = asyncio.get_running_loop().create_future() fut = asyncio.get_running_loop().create_future()
self.inflight[response_topic] = fut self.inflight[response_topic] = fut
self.client.publish(setting_topic, payload=value, qos=0, retain=True, self.client.publish(setting_topic, payload=value, qos=0, retain=True,
@ -86,7 +86,7 @@ def main():
epilog='''Example: epilog='''Example:
%(prog)s -v -b mqtt dt/sinara/stabilizer afe/0 '"G10"' %(prog)s -v -b mqtt dt/sinara/stabilizer afe/0 '"G10"'
''') ''')
parser.add_argument('-v', '--verbose', action='count', parser.add_argument('-v', '--verbose', action='count', default=0,
help='Increase logging verbosity') help='Increase logging verbosity')
parser.add_argument('--broker', '-b', default='mqtt', type=str, parser.add_argument('--broker', '-b', default='mqtt', type=str,
help='The MQTT broker address') help='The MQTT broker address')
@ -108,7 +108,7 @@ def main():
async def configure_settings(): async def configure_settings():
interface = await Miniconf.create(args.prefix, args.broker) interface = await Miniconf.create(args.prefix, args.broker)
response = await interface.command(args.path, json.loads(args.value)) response = await interface.command(args.path, json.loads(args.value))
logger.info(response) print(f"Response: {response}")
loop.run_until_complete(configure_settings()) loop.run_until_complete(configure_settings())