Averaging RSSI Values in Python

I am using the code found in the “RSSI in Python” thread as follows…


import zigbee, struct
rssi_raw = zigbee.ddo_get_param(‘[00:13:a2:00:40:0a:12:96]!’, ‘DB’)

rssi_val = struct.unpack(‘=B’, rssi_raw)

It is to my understanding that this is only using the last packet to determine signal strength. To make my system more accurate I would like to average numerous packages. Unfortunately my understanding of python is elementary, so I am asking if it is even possible to do this, and if so what would be the best method.

A method I think could work, would be to store a series of rssi_val values and average those, but I feel that this would slow down the calculation speed significantly.

Any advice will be greatly appreciated. Thank you in advance.