Skip to content

Commit

Permalink
Default MQTT values (#47)
Browse files Browse the repository at this point in the history
* Default MQTT values prevent breaking on upgrades
* Adds the GitHub pull-req add-on for VS Code
  • Loading branch information
mpepping authored Jan 3, 2023
1 parent 59f669f commit 1d413ed
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"github.copilot",
"github.vscode-pull-request-github",
"ms-python.python",
"oderwat.indent-rainbow",
"ms-python.vscode-pylance"
"ms-python.vscode-pylance",
"oderwat.indent-rainbow"
]
}
},
Expand Down
2 changes: 2 additions & 0 deletions solarman/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
"topic": {"type": "string"},
"username": {"type": "string"},
"password": {"type": "string"},
"qos": {"type": "integer", "minimum": 1, "maximum": 1},
"retain": {"type": "boolean"},
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions solarman/mqtt.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ def __init__(self, config):
self.port = config["port"]
self.username = config["username"]
self.password = config["password"]
self.qos = config["qos"]
self.retain = config["retain"]
self.qos = config.get("qos", 1)
self.retain = config.get("retain", True)
self.client = Mqtt.connect(self)

def connect(self):
Expand Down

0 comments on commit 1d413ed

Please sign in to comment.