Reading RSSI values in MicroPython on Xbee 3

I am currently trying to save the rssi value between two Xbee 3s at a certain instance using the xbee.discover() function. My issue is that this returns an iterator yielding a dictionary for each discovered node that I do not know how to take a single key/value from.

Is there something to change with my code to handle the iterator or is there a better way to read rssi values in micropython.

The XBee.discovery is running the ND command on the radio. If you simply want to read the RSSI level after a packet is received, try using the xbee.atcmd function to query the DB command.

https://www.digi.com/resources/documentation/digidocs/90002219/default.htm#reference/r_function_atcmd.htm?Highlight=at%20command