From 24e3a9ddc03def28a29859b808b21e171eb5e0c3 Mon Sep 17 00:00:00 2001 From: doudz Date: Mon, 30 Jul 2018 22:08:50 +0200 Subject: [PATCH] universal connect --- zigate/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/zigate/__init__.py b/zigate/__init__.py index 762d7c72..364db0f2 100644 --- a/zigate/__init__.py +++ b/zigate/__init__.py @@ -8,3 +8,11 @@ __all__ = ['ZiGate', 'ZiGateWiFi', 'dispatcher'] + + +def connect(port=None, host=None): + if host: + z = ZiGateWiFi(host) + else: + z = ZiGate(port) + return z \ No newline at end of file