Skip to content
This repository has been archived by the owner on Jul 19, 2023. It is now read-only.

Pb with list argument #20

Open
cedricmeschin opened this issue Aug 31, 2022 · 1 comment
Open

Pb with list argument #20

cedricmeschin opened this issue Aug 31, 2022 · 1 comment

Comments

@cedricmeschin
Copy link

Hi, I discover this script and I test it.
When I run netatmo test, connection is ok
netatmo.py xxx@xxx : OK

but when I run netatmo list
it return me an error like this:
1 station 70:ee:50:xx.xx.xx MyHome (Indoor) MyCity FR Traceback (most recent call last): File "/usr/local/bin/netatmo", line 8, in <module> sys.exit(main()) File "/usr/local/lib/python3.9/dist-packages/netatmo/netatmo.py", line 929, in main args.func(args) File "/usr/local/lib/python3.9/dist-packages/netatmo/netatmo.py", line 792, in list_stations module["module_name"], KeyError: 'module_name'

Here is anonimysed return of "module" variable (I added print(module) in line 798)
{'_id': '70:ee:50:xx:xx:xx', 'date_setup': 1658014428, 'last_setup': 1658014428, 'type': 'NAMain', 'last_status_store': 1661957324, 'firmware': 181, 'wifi_status': 60, 'reachable': True, 'co2_calibrating': False, 'data_type': ['Temperature', 'CO2', 'Humidity', 'Noise', 'Pressure'], 'place': { 'altitude': 20, 'city': 'MyCity', 'country': 'FR', 'timezone': 'Europe/Paris', 'location': [x.xxxxxxxxxx, x.xxxxxxxxx]}, 'station_name': 'MyHome (Indoor)', 'home_id': '61a69ec32ac81348e60ebc14', 'home_name': 'MyHome', 'dashboard_data': { 'time_utc': 1661957322, 'Temperature': 26.6, 'CO2': 513, 'Humidity': 64, 'Noise': 47, 'Pressure': 1015.4, 'AbsolutePressure': 1013, 'min_temp': 23.2, 'max_temp': 26.7, 'date_max_temp': 1661951570, 'date_min_temp': 1661931366, 'temp_trend': 'stable', 'pressure_trend': 'stable' }, 'modules': [{ '_id': '02:00:00:xx:xx:xx', 'type': 'NAModule1', 'module_name': 'Extérieur', 'data_type': ['Temperature', 'Humidity'], 'battery_percent': 97, 'reachable': True, 'last_setup': 1658014429, 'firmware': 50, 'last_message': 1661957317, 'last_seen': 1661957298, 'rf_status': 59, 'battery_vp': 5950, 'dashboard_data': { 'time_utc': 1661957298, 'Temperature': 26.3, 'Humidity': 63, 'min_temp': 19.7, 'max_temp': 28.7, 'date_max_temp': 1661951248, 'date_min_temp': 1661908047, 'temp_trend': 'stable' } }] }

Thanks for your help.
Regards

@rene-d
Copy link
Owner

rene-d commented Sep 18, 2022

Replace module["module_name"],at line 794 by module.get("module_name", "unknown"),

Or use the Git version, it has the fix.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants