How to get an attribute within an attribute within an entity attribute

My router has an entity of online devices that has an attribute called ‘devices’. Within the ‘devices’ attribute, it has the name of the device and inside that there are additional attributes.

I would like to know if a certain named device is connected Wired or Wireless (and maybe also the ip address). The list changes so I cannot simply use the index number of the name.
For example I want to find the name ‘Echo-Living room’ within the ‘devices’ attribute and then get the value of the ‘connection’ attribute within the ‘- name: Echo-Living room’.

{{ state_attr('sensor.mesh_online_devices', 'devices') 
| selectattr('name', 'eq', 'Echo-Living room') 
| map(attribute = 'connection')
| first | default('Device not Connected', 1) }}

Thank you for the quick reply.
When I copied your code into the Developer tools I got the error,

TemplateSyntaxError: expected token ‘,’, got ‘connection’

There was a filthy, “pretty” quote mark at the end of the select… I have fixed it in the post above.

Thank you very much! That works great!