Appdaemon get_states() not available immediately?

I’m working on some code for a dimmer switch. When it’s held, there is an event “up_held”. I am triggering on this event and increasing the brightness of the bulb. This requires getting the states of the bulb first. I want to make sure it’s on, and also see what the current brightness is.

I do this with one line of code:

self.states = self.get_state(self.args["entity"], attribute="all")

I try and grab the brightness from the return, but an exception is raised that is not an attribute.

    self.log(self.states['brightness'])
             ~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'brightness'

However, I do get a return when I look at

self.log(self.states)

{'entity_id': 'light.bedroom_overhead_1', 'state': 'on', 'attributes': {'min_color_temp_kelvin': 2000, 'max_color_temp_kelvin': 6493, 'min_mireds': 154, 'max_mireds': 500, 'supported_color_modes': ['color_temp', 'xy'], 'color_mode': 'color_temp', 'brightness': 1, 'color_temp_kelvin': 3546, 'color_temp': 282, 'hs_color': [27.128, 43.783], 'rgb_color': [255, 193, 143], 'xy_color': [0.451, 0.372], 'friendly_name': 'Bedroom Overhead 1', 'supported_features': 40}, 'last_changed': '2023-11-27T01:40:43.098301+00:00', 'last_updated': '2023-11-27T01:40:43.098301+00:00', 'context': {'id': '01HG76Z55ZRW9D6GXY3V90M1C6', 'parent_id': None, 'user_id': '324b490a6c814ce695b14dee9d6652e3'}}

My suspicion is that the what I am seeing is not happening in real time, and that the brightness attribute isn’t available to me when I want it to be. This happens with all attributes except for “state”

Is there some trickery I can implement to “wait” for the get_state object to be completely filled before accessing the contents?

Need to access the attribute by using self.states["attributes"]["brightness"]