Skip to content

Commit

Permalink
Merge pull request #20 from SphtKr/merge-fix-from-19
Browse files Browse the repository at this point in the history
Fix bad merge in #19
  • Loading branch information
SphtKr authored Jan 12, 2025
2 parents f015406 + 7766d0e commit 1231fa4
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions aqualogic_mqtt/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,20 +189,11 @@ def loop_forever(self):
ha_group = parser.add_argument_group("Home Assistant options")
ha_group.add_argument('-p', '--discover-prefix', default="homeassistant", type=str,
help="MQTT prefix path (default is \"homeassistant\")")

parser.add_argument('-m', '--mqtt-dest', required=True, type=str, help="MQTT broker destination in the format host:port")
source_group = parser.add_mutually_exclusive_group(required=True)
source_group.add_argument('-s', '--serial', type=str, help="serial device source (path)")
source_group.add_argument('-t', '--tcp', type=str, help="network serial adapter source in the format host:port")
parser.add_argument('-p', '--discover-prefix', default="homeassistant", type=str, help="MQTT prefix path (default is \"homeassistant\")")

args = parser.parse_args()

source = args.serial if args.serial is not None else args.tcp
dest = args.mqtt_dest

mqtt_client = Client(discover_prefix=args.discover_prefix)
mqtt_client.connect_mqtt(dest=dest)
mqtt_client.connect_panel(source)

mqtt_client = Client(discover_prefix=args.discover_prefix,
client_id=args.mqtt_clientid, transport=args.mqtt_transport,
Expand Down

0 comments on commit 1231fa4

Please sign in to comment.