Continuous aggregation for data series and fetch entire row of max value

We have sensor data of deviceid ,source, time, proximity and continues aggregation work to find the max proximity of device based on time interval.
But the requirement is to find the source and other column data where the max proximity condition is matched in a given time interval.
from below can retieve time,deviceid,max proximity … but also need source column.
CREATE MATERIALIZED VIEW test_stream_events
(reported,device_id,min_val)
WITH (timescaledb.continuous) AS
SELECT
time_bucket(‘2min’, reported_time) AS reported,
device_id
MAX(attribute_value)
FROM yojee_ws.test_stream
GROUP BY reported,device_id;