def _parse_update_data(topic, data):
 parts = topic.split('/')
 room = parts[(-1)]
 device_id = slugify(data.get(ATTR_ID)).upper()
 distance = data.get('distance')
 parsed_data = {ATTR_DEVICE_ID: device_id, ATTR_ROOM: room, ATTR_DISTANCE: distance}
 return parsed_data

def _parse_update_data ( topic , data ) : parts = topic . split ( '/' ) room = parts [ ( - 1 ) ] device_id = slugify ( data . get ( ATTR_ID ) ) . upper ( ) distance = data . get ( 'distance' ) parsed_data = { ATTR_DEVICE_ID : device_id , ATTR_ROOM : room , ATTR_DISTANCE : distance } return parsed_data
parse the room presence update .