Fix Python 3.10+/websockets compatibility, add CLI args and .gitignore
- ws/message.py, ws/server/ws_server_multi_user.py: drop the loop= kwarg and replace asyncio.wait(coroutines) with asyncio.gather(), both of which were removed/forbidden in Python 3.10+. - brewpi/requirements.txt: pin websockets==10.4, the latest version that still supports this code's serve()/handler API. - config.json.sim: move Model to the top level and add the missing gain field so it matches the schema brewpi.py and config.json.templ expect. - brewpi/brewpi.py: add -c/-m/-s/-d CLI args for selecting config/model files, simulation mode, and debug. - .gitignore: exclude __pycache__, logs, the local config.json, and editor/venv directories. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+10
-1
@@ -11,8 +11,17 @@ from components.actor import HeaterFactory, StirrerFactory
|
||||
from tasks import TaskManager, TempSensorTask, HeaterTask, PotTask, TcTask, StirrerTask, TracerTask
|
||||
from tracer import Tracer
|
||||
|
||||
import argparse as ap
|
||||
|
||||
if __name__ == '__main__':
|
||||
config = json.load(open("config.json"))
|
||||
parser = ap.ArgumentParser()
|
||||
parser.add_argument("-d", "--debug", action="store_true")
|
||||
parser.add_argument("-c", "--config", default="config.json")
|
||||
parser.add_argument("-m", "--model", default="model.json")
|
||||
parser.add_argument("-s", "--sim", action="store_true")
|
||||
|
||||
args = parser.parse_args()
|
||||
config = json.load(open(args.config))
|
||||
dispatcher = MessageDispatcher()
|
||||
server = WsServerMultiUser(listener=dispatcher)
|
||||
taskmgr = TaskManager()
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
numpy
|
||||
scipy
|
||||
matplotlib
|
||||
websockets==10.4
|
||||
dpath
|
||||
|
||||
Reference in New Issue
Block a user