def METHOD_NAME(self, msg: BinaryMessageDefinition) -> None:
    """The callback to parse messages with estop data."""
    if isinstance(msg, EstopButtonDetectionChange):
        self._state.left_detected = msg.aux1_detected.value > 0
        self._state.right_detected = msg.aux2_detected.value > 0
    elif isinstance(msg, EstopStateChange):
        self._state.engaged = msg.engaged.value > 0
    else:
        # Don't call listeners if this was an unrelated message
        return
    for listener in self._listeners:
        listener(self._state)