Skip to content

Commit 6d80e76

Browse files
committed
Return all available information
1 parent 16b9ebb commit 6d80e76

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

eternalegypt/eternalegypt.py

+8
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
from aiohttp.client_exceptions import ClientError
99
import async_timeout
1010
import attr
11+
import flatten_json
1112

1213
TIMEOUT = 3
1314

@@ -48,6 +49,7 @@ class Information:
4849
current_band = attr.ib(default=None)
4950
cell_id = attr.ib(default=None)
5051
sms = attr.ib(factory=list)
52+
everything = attr.ib(factory=dict)
5153

5254

5355
def autologin(function, timeout=TIMEOUT):
@@ -252,6 +254,12 @@ def _build_information(self, data):
252254
result.sms.append(element)
253255
result.sms.sort(key=lambda sms: sms.id)
254256

257+
result.everything = {
258+
key.lower(): value
259+
for key, value in flatten_json.flatten(data, '.').items()
260+
if value != {}
261+
}
262+
255263
return result
256264

257265
@autologin

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
name='eternalegypt',
77
packages=['eternalegypt'],
88
version='0.0.8',
9-
install_requires=['aiohttp>=3.0.1','attrs'],
9+
install_requires=['aiohttp>=3.0.1','attrs','flatten-json'],
1010
description='Netgear LTE modem API',
1111
author='Anders Melchiorsen',
1212
author_email='amelchio@nogoto.net',

0 commit comments

Comments
 (0)