Skip to content

Commit

Permalink
allow mcws to be optional
Browse files Browse the repository at this point in the history
  • Loading branch information
3ll3d00d committed Jan 13, 2024
1 parent f6b4165 commit 02a04ea
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions cmdserver/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ def create_app(cfg: Config) -> Tuple[Flask, 'WsServer']:
mqtt = None
if cfg.mqtt:
mqtt = MQTT(cfg.mqtt['ip'], cfg.mqtt.get('port', 1883), cfg.mqtt.get('user', None), cfg.mqtt.get('cred', None))
info_provider = InfoProvider(cfg, ws_server, mqtt)
info_provider = None
if cfg.mcws:
info_provider = InfoProvider(cfg, ws_server, mqtt)
resource_args = {
'command_controller': CommandController(cfg),
'tivoController': TivoController(cfg, mqtt),
Expand All @@ -51,13 +53,15 @@ def decorate_ns(ns, p=None):

decorate_ns(commands.api)
decorate_ns(command.api)
decorate_ns(playingnow.api)
if info_provider:
decorate_ns(playingnow.api)
decorate_ns(tivos.api)
decorate_ns(tivo.api)
decorate_ns(info.api)
decorate_ns(pj.api)
decorate_ns(version.api)
decorate_ns(wake.api)
if info_provider:
decorate_ns(wake.api)
return app, ws_server


Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ezmote-cmdserver"
version = "1.1.18"
version = "1.1.19"
description = "A small webapp which can be used for web based home cinema automation"
authors = ["3ll3d00d <mattkhan+cmdserver@gmail.com>"]
license = "MIT"
Expand Down

0 comments on commit 02a04ea

Please # to comment.