mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
refactored ddwrt data format parsong code
This commit is contained in:
parent
a959c48708
commit
242c143c85
@ -154,9 +154,6 @@ class DdWrtDeviceScanner(object):
|
||||
def _parse_ddwrt_response(data_str):
|
||||
""" Parse the awful DD-WRT data format, why didn't they use JSON????.
|
||||
This code is a python version of how they are parsing in the JS """
|
||||
data = {}
|
||||
pattern = re.compile(r'\{(\w+)::([^\}]*)\}')
|
||||
for (key, val) in re.findall(pattern, data_str):
|
||||
data[key] = val
|
||||
|
||||
return data
|
||||
return {
|
||||
key: val for key, val in re.compile(r'\{(\w+)::([^\}]*)\}')
|
||||
.findall(data_str)}
|
||||
|
Loading…
x
Reference in New Issue
Block a user