Skip to content

Commit

Permalink
Fix BLE
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexxIT committed Nov 3, 2020
1 parent 1272543 commit c438551
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions custom_components/xiaomi_gateway3/core/gateway3.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,8 @@ def process_ble_event(self, raw: Union[bytes, str]):
try:
if isinstance(raw, bytes):
# fix two json bug
if '}{' in raw:
raw = raw[:raw.index('}{') + 1]
if b'}{' in raw:
raw = raw[:raw.index(b'}{') + 1]
m = RE_JSON.search(raw)
data = json.loads(m[0])['params']
else:
Expand Down Expand Up @@ -607,8 +607,8 @@ def process_mesh_data(self, raw: Union[bytes, list]):
try:
if isinstance(raw, bytes):
# fix two json bug
if '}{' in raw:
raw = raw[:raw.index('}{') + 1]
if b'}{' in raw:
raw = raw[:raw.index(b'}{') + 1]
m = RE_JSON.search(raw)
data = json.loads(m[0])['params']
else:
Expand Down

0 comments on commit c438551

Please sign in to comment.