diff --git a/README.md b/README.md index 27d24d5..f5e5974 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ # Aqara-MQTT [![Build Status](https://travis-ci.org/monster1025/aqara-mqtt.svg?branch=master)](https://travis-ci.org/monster1025/aqara-mqtt) + Aqara (Xiaomi) Gateway to MQTT bridge. I use it for home assistant integration and it works well now. diff --git a/src/main.py b/src/main.py index f0b7f82..ba34342 100644 --- a/src/main.py +++ b/src/main.py @@ -55,7 +55,7 @@ def read_motion_data(gateway, client, polling_interval, polling_models, stop_eve data = json.loads(sensor_resp['data']) state = data.get("status", None) short_id = sensor_resp['short_id'] - if ( device['data'] != data or first): + if device['data'] != data or first: device['data'] = data _LOGGER.debug("Polling result differs for " + str(model) + " with sid(First: " + str(first) + "): " + str(sid) + "; " + str(data)) client.publish(model, sid, data) diff --git a/src/xiaomihub.py b/src/xiaomihub.py index 2745a8b..d723f35 100644 --- a/src/xiaomihub.py +++ b/src/xiaomihub.py @@ -88,9 +88,6 @@ class XiaomiHub: resp = self._send_cmd(cmd, "read_ack") model = resp["model"] - if model == '': - model = 'cube' - xiaomi_device = { "model":model, "sid":resp["sid"],