Skip to content

Commit

Permalink
Merge pull request #50 from jpmeijers/patch-1
Browse files Browse the repository at this point in the history
Update toservice.py
  • Loading branch information
jim-easterbrook committed Aug 11, 2017
2 parents 001b76b + 38076f0 commit 081df44
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pywws/toservice.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,10 @@ def mqtt_send_data(self, timestamp, prepared_data, ignore_last_update=False):
mosquitto_client = mosquitto.Mosquitto(client_id)
if auth:
self.logger.debug("Username and password configured")
mosquitto_client.username_pw_set(self.user, self.password)
if(self.password == "unknown"):
mosquitto_client.username_pw_set(self.user)
else:
mosquitto_client.username_pw_set(self.user, self.password)
else:
self.logger.debug("Username and password unconfigured, ignoring")
self.logger.debug(
Expand Down

0 comments on commit 081df44

Please sign in to comment.